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 5ccb3fc..1758f13 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"