]> git.tue.mpg.de Git - gsu.git/commitdiff
subcommand: Declare $opt as local.
authorAndre Noll <maan@tuebingen.mpg.de>
Sat, 14 Oct 2017 20:59:55 +0000 (22:59 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Mon, 6 Nov 2017 11:30:22 +0000 (12:30 +0100)
Without the local keyword, gsu_cword_is_option_parameter() might
overwrite a variable of the caller.

subcommand

index c04f23feeb5ae018ce0e0ae1fea46efe20318b40..7318c9e880396e5118a117639050fac2ba063e95 100644 (file)
@@ -493,7 +493,8 @@ EOF
 #
 gsu_cword_is_option_parameter()
 {
-       local opts="$1" cword="$2" prev i n
+       local opts="$1" cword="$2"
+       local opt prev i n
        local -a words
 
        result=