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 c04f23f..7318c9e 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=