]> git.tue.mpg.de Git - gsu.git/commitdiff
gsu: Avoid referencing an unset variable.
authorAndre Noll <maan@systemlinux.org>
Fri, 27 Jul 2012 08:58:12 +0000 (10:58 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Fri, 29 Aug 2014 19:39:58 +0000 (21:39 +0200)
This causes an error if scripts use set -u.

misc/gsu/subcommand

index 5ccb3fc54fd309065482522b67a22c6e292934f2..1758f13b4ebd6f50a00996823ce0d4cf6b3b6fe1 100644 (file)
@@ -115,7 +115,7 @@ _com_prefs()
                local name= option_type= default_value= required=
                local description= help_text=
                eval "${gsu_options[$i]}"
-               eval val='"$'${gsu_config_var_prefix}_$name'"'
+               eval val='"${'${gsu_config_var_prefix}_$name:-'}"'
                case "$required" in
                true|yes)
                        printf "# required"