]> git.tuebingen.mpg.de Git - gsu.git/blobdiff - funcs/gsu
gsu: Fix handling of config options with newlines.
[gsu.git] / funcs / gsu
index 673605e43bbca8e66940722b7c587b72ba84964b..3f7d379ffcf3867b2c07a660626db17ca2b5cb9a 100644 (file)
--- a/funcs/gsu
+++ b/funcs/gsu
@@ -378,7 +378,7 @@ _gsu_check_options()
                        return
                esac
 
-               eval ${gsu_config_var_prefix}_$name='"'${val:=$default_value}'"'
+               eval ${gsu_config_var_prefix}_$name='"'\${val:=$default_value}'"'
                # Check option type. ATM, only num and string are supported
                # Other types may be added without breaking compatibility
                case "$option_type" in
@@ -427,7 +427,7 @@ gsu_getopts()
 
        ret=-$E_GSU_GETOPTS
        result="invalid optstring $1"
-       if [[ -z "$1" || "$1" =~ "::" ]]; then
+       if [[ -z "$1" ]] || grep -q '::' <<< "$1" ; then
                gsu_err_msg
                exit 1
        fi