summaryrefslogtreecommitdiff
path: root/tools/warn/java_warn_patterns.py
diff options
context:
space:
mode:
author Guillaume Chelfi <chelfi@google.com> 2019-10-03 12:02:46 +0200
committer Guillaume Chelfi <chelfi@google.com> 2019-10-03 12:02:46 +0200
commitce000fdc4d7bbc5729f681435b1daf50e9db3a28 (patch)
tree15b7ca81a1183f591aba901a072c58928fc01692 /tools/warn/java_warn_patterns.py
parent147f46ba723143840d34adb92fbc942816a5bb36 (diff)
Fix zsh compatibility issue in build/envsetup.sh
Arrays are zero indexed in bash and one indexed in zsh by default. This leads to an off-by-one issue in the `godir` and `choosevariant` commands: when prompted to chose an option, in order to pick option "n" you have to input "n+1". In those two specific instances, by using "substring expansion" instead of array indexing, one can get consistent behaviour between bash and zsh (equivalent to zero indexing). Test: manual - # godir $ zsh $ source build/envsetup.sh $ godir SurfaceFlinger # There should be many options # Pick 1, check that you end up in the right location $ godir SurfaceFlinger.cpp # There should be only one possibility # make sure you end up in the right location # repeat with bash (to ensure compatibility is not broken) # choosevariant $ zsh $ source build/envsetup.h $ choosevariant # pick whatever variant you want $ printconfig # make sure the variant matches your choice # repeat with bash (to ensure compatibility is not broken) Change-Id: I998d8fb48b708066b6db28a2129a2b09785fb0b1
Diffstat (limited to 'tools/warn/java_warn_patterns.py')
0 files changed, 0 insertions, 0 deletions