diff options
author | Tom de Vries <tdevries@suse.de> | 2024-11-19 12:32:40 +0100 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2024-11-19 12:32:40 +0100 |
commit | f5e259f32f011dc563b3da9e279acaee3aafba8e (patch) | |
tree | b4dc0a63335725f397bccd211baa5b64ddf6fcce | |
parent | cb45bd59481353217ebf18d67c6b013ab2d2f263 (diff) | |
download | gdb-f5e259f32f011dc563b3da9e279acaee3aafba8e.zip gdb-f5e259f32f011dc563b3da9e279acaee3aafba8e.tar.gz gdb-f5e259f32f011dc563b3da9e279acaee3aafba8e.tar.bz2 |
Fix shellcheck warnings in spellcheck.sh, found using shellcheck v0.10.0.
Ran shellcheck v0.10.0 (on a system with shellcheck version 0.8.0) using this
command from an RFC patch [1]:
...
$ ./gdb/contrib/pre-commit-shellcheck.sh ./gdb/contrib/spellcheck.sh
...
Tested on x86_64-linux
[1] https://sourceware.org/pipermail/gdb-patches/2024-November/213400.html
-rwxr-xr-x | gdb/contrib/spellcheck.sh | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gdb/contrib/spellcheck.sh b/gdb/contrib/spellcheck.sh index d15e124..420891f 100755 --- a/gdb/contrib/spellcheck.sh +++ b/gdb/contrib/spellcheck.sh @@ -269,13 +269,13 @@ parse_dictionary () local i word replacement i=0 for word in "${words[@]}"; do - replacement=${replacements[$i]} + replacement=${replacements[i]} # Skip words that are already handled. This ensures that the local # dictionary overrides the wiki dictionary. if [ "${words_done[$word]}" == 1 ]; then - words[$i]="" - replacements[$i]="" + words[i]="" + replacements[i]="" i=$((i + 1)) continue fi @@ -283,8 +283,8 @@ parse_dictionary () # Skip identity rules. if [ "$word" = "$replacement" ]; then - words[$i]="" - replacements[$i]="" + words[i]="" + replacements[i]="" fi i=$((i + 1)) @@ -296,7 +296,7 @@ print_dictionary () local i word replacement i=0 for word in "${words[@]}"; do - replacement=${replacements[$i]} + replacement=${replacements[i]} i=$((i + 1)) if [ "$word" == "" ]; then @@ -519,7 +519,7 @@ main () local i word replacement i=0 for word in "${words[@]}"; do - replacement=${replacements[$i]} + replacement=${replacements[i]} i=$((i + 1)) if [ "$word" = "" ]; then |