]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Another empty argument through expr workaround.
authorEric Blake <eblake@redhat.com>
Tue, 20 Jul 2010 14:06:16 +0000 (08:06 -0600)
committerEric Blake <eblake@redhat.com>
Tue, 20 Jul 2010 15:03:11 +0000 (09:03 -0600)
* 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.

Signed-off-by: Eric Blake <eblake@redhat.com>
ChangeLog
lib/autoconf/status.m4
tests/torture.at

index bd7c15f8ee0973e680d2c1fe04460c4749c993fb..1a620898e113098f86a74ec3c4f9c058087daedd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 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.
index b9e70264df36313f793163a8980f2beb80c6446f..56190a4238393d40aa9288a50cce4af6d446bd7a 100644 (file)
@@ -1464,11 +1464,16 @@ ac_need_defaults=:
 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]
@@ -1491,6 +1496,7 @@ m4_ifdef([_AC_SEEN_CONFIG(FILES)], [dnl
     $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;;
index e7f61ed119d5d46791101148d542ace0a5ffc01c..ff0592847622dd8a6ec43b9f493d95717099eee3 100644 (file)
@@ -276,6 +276,12 @@ if test -w /dev/full && test -c /dev/full; then
           [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