bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newlines in non-literal tag list in AC_CONFIG_FOO


From: Ralf Wildenhues
Subject: Re: Newlines in non-literal tag list in AC_CONFIG_FOO
Date: Fri, 1 Aug 2008 00:22:10 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

Hello, and sorry for the long delay,

* Ralf Wildenhues wrote on Thu, Jun 26, 2008 at 11:20:46PM CEST:
> * Andreas Schwab wrote on Thu, Jun 26, 2008 at 05:53:33PM CEST:
> > foo="Makefile
> > foo"
> > AC_CONFIG_FILES([$foo])
> 
> > The docs say that the tag list can be blank or newline separated, not
> > distinguishing between literals and non-literals.
> 
> Yes, that bug has been reported before and I've neglected to fix it so
> far.  Sorry about that.  I didn't see a way to fix it without weakening
> the testsuite at least somewhat; I'll try to look again soon.

Proposed patch.  This mistreats globs (files with "?" or "*" in the
name); and of course whitespace but that's a limitation of
AC_CONFIG_FILES anyway.

Note that this patch still allows
  ./config.status --file='name with special characters'

Should I take precautions against globs?

Thanks,
Ralf

2008-08-01  Ralf Wildenhues  <address@hidden>

        * lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS): Flatten
        whitespace in $ac_config_files and $ac_config_headers.
        * tests/torture.at (Parameterized AC_CONFIG_FILES): New test.
        Report by Andreas Schwab and Per √ėyvind Karlsen.

diff --git a/lib/autoconf/status.m4 b/lib/autoconf/status.m4
index 4d22085..4897461 100644
--- a/lib/autoconf/status.m4
+++ b/lib/autoconf/status.m4
@@ -1357,6 +1357,18 @@ on `(hostname || uname -n) 2>/dev/null | sed 1q`
 
 _ACEOF
 
+dnl remove any newlines from these variables.
+m4_ifdef([_AC_SEEN_CONFIG(FILES)],
+[case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$[*];;
+esac
+])
+m4_ifdef([_AC_SEEN_CONFIG(HEADERS)],
+[case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$[*];;
+esac
+])
+
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 # Files that config.status was made for.
 m4_ifdef([_AC_SEEN_CONFIG(FILES)],
diff --git a/tests/torture.at b/tests/torture.at
index 92f8d5b..44fdcd5 100644
--- a/tests/torture.at
+++ b/tests/torture.at
@@ -43,6 +43,23 @@ AT_CHECK_AUTOCONF([], 1, [], [ignore])
 AT_CLEANUP
 
 
+## ------------------------------- ##
+## parameterized AC_CONFIG_FILES.  ##
+## ------------------------------- ##
+
+AT_SETUP([Parameterized AC_CONFIG_FILES])
+
+AT_CONFIGURE_AC([[
+files="foo
+bar"
+AC_CONFIG_FILES([$files])]])
+AT_CHECK_AUTOCONF([], [], [], [ignore])
+touch foo.in bar.in config.hin
+AT_CHECK_CONFIGURE
+
+AT_CLEANUP
+
+
 
 ## ------------ ##
 ## AC_ARG_VAR.  ##




reply via email to

[Prev in Thread] Current Thread [Next in Thread]