From: Paul Eggert Date: Tue, 20 Mar 2018 03:19:01 +0000 (-0700) Subject: lib: use list of unsafe chars, not safe ones X-Git-Tag: v2.69b~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=487d6aaaa4fe45001d30c439ea6240fc74f1b5d7;p=thirdparty%2Fautoconf.git lib: use list of unsafe chars, not safe ones * lib/autoconf/general.m4 (_AC_INIT_CONFIG_LOG): Rely on list of unsafe chars instead of list of safe ones. This corresponds more closely to POSIX and should result in less quoting. * lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS): Adjust to this change. x --- diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index 5fde689b..58f7a64c 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -1192,10 +1192,18 @@ do esac AS_VAR_APPEND([ac_configure_args_raw], [" '$ac_arg'"]) done -ac_safe_unquote="[[a-zA-Z0-9_=\/,-]]" -ac_configure_args_raw=`dnl -AS_ECHO(["${ac_configure_args_raw} "]) |dnl -sed "s/'\($ac_safe_unquote$ac_safe_unquote*\)' /\1 /g; s/ $//"` + +case $ac_configure_args_raw in + *$as_nl*) + ac_safe_unquote= ;; + *) + ac_unsafe_z='|&;<>()$`\\"*?@<:@ '' ' # This string ends in space, tab. + ac_unsafe_a="$ac_unsafe_z#~" + ac_safe_unquote="s/ '\\([[^$ac_unsafe_a]][[^$ac_unsafe_z]]*\\)'/ \\1/g" + ac_configure_args_raw=`dnl + AS_ECHO(["$ac_configure_args_raw"]) | sed "$ac_safe_unquote"`;; +esac + cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. diff --git a/lib/autoconf/status.m4 b/lib/autoconf/status.m4 index c7d0ad0e..69465bd0 100644 --- a/lib/autoconf/status.m4 +++ b/lib/autoconf/status.m4 @@ -1431,9 +1431,7 @@ m4_if(m4_index(m4_defn([AC_PACKAGE_NAME]), [GNU ]), [0], [ General help using GNU software: .])])" _ACEOF -ac_cs_config=`dnl -AS_ECHO(["${ac_configure_args} "]) |dnl -sed --posix "s/'\($ac_safe_unquote$ac_safe_unquote*\)' /\1 /g; s/ $//"` +ac_cs_config=`AS_ECHO(["$ac_configure_args"]) | sed "$ac_safe_unquote"` ac_cs_config_escaped=`AS_ECHO(["$ac_cs_config"]) | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped'