2010-07-20 Eric Blake <eblake@redhat.com>
+ Another empty argument through expr workaround.
+ * lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS): Detect empty
+ arguments. Reject empty file argument.
+ * tests/torture.at (AC_CONFIG_FILES, HEADERS, LINKS and COMMANDS):
+ Check for missing argument.
+
Also reject ' and newline from AC_INIT strings.
* lib/autoconf/general.m4 (_AC_INIT_LITERAL): Reject a couple more
problematic characters.
while test $[#] != 0
do
case $[1] in
- --*=*)
+ --*=?*)
ac_option=`expr "X$[1]" : 'X\([[^=]]*\)='`
ac_optarg=`expr "X$[1]" : 'X[[^=]]*=\(.*\)'`
ac_shift=:
;;
+ --*=)
+ ac_option=`expr "X$[1]" : 'X\([[^=]]*\)='`
+ ac_optarg=
+ ac_shift=:
+ ;;
*)
ac_option=$[1]
ac_optarg=$[2]
$ac_shift
case $ac_optarg in
*\'*) ac_optarg=`AS_ECHO(["$ac_optarg"]) | sed "s/'/'\\\\\\\\''/g"` ;;
+ '') AC_MSG_ERROR([missing file argument]) ;;
esac
AS_VAR_APPEND([CONFIG_FILES], [" '$ac_optarg'"])
ac_need_defaults=false;;
[1], [ignore], [ignore])
fi
+# Validate that --file requires an argument
+AT_CHECK([./config.status --file], [1], [ignore], [stderr])
+AT_CHECK([grep 'missing file argument' stderr], [0], [ignore])
+AT_CHECK([./config.status --file=], [1], [ignore], [stderr])
+AT_CHECK([grep 'missing file argument' stderr], [0], [ignore])
+
# Create a header
AT_CHECK_CONFIG_CREATION_NOWRITE(header)
# Create a header on stdout