]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Properly expand @configure_input@ in config.status.
authorBenoit Sigoure <tsuna@lrde.epita.fr>
Tue, 18 Dec 2007 12:54:06 +0000 (13:54 +0100)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 2 Mar 2008 11:50:55 +0000 (12:50 +0100)
* lib/autoconf/status.m4 (_AC_OUTPUT_FILE, _AC_OUTPUT_MAIN_LOOP):
Escape the backslashes and ampersands in $configure_input before
using it in the sed replacement string to expand @configure_input@.
Report by Eric Blake and Patrick Welche.

Signed-off-by: Benoit Sigoure <tsuna@lrde.epita.fr>
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
ChangeLog
lib/autoconf/status.m4

index 0088f5c82285509d0001e626086519e7e1b5a684..38cfe8e622cf0ae7e9e3e0737d6d66785a70e0d1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-03-01  Benoit Sigoure  <tsuna@lrde.epita.fr>
+       and Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Properly expand @configure_input@ in config.status.
+       * lib/autoconf/status.m4 (_AC_OUTPUT_FILE, _AC_OUTPUT_MAIN_LOOP):
+       Escape the backslashes and ampersands in $configure_input before
+       using it in the sed replacement string to expand @configure_input@.
+       Report by Eric Blake and Patrick Welche.
+
 2008-03-01  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        Ignore errors from ./run on w32.
index 8afa9bae9fd467bbda96b30487fb2eed26b9e23b..398d0cbadd36f50703a74aa69a2ab86631caf609 100644 (file)
@@ -1,7 +1,7 @@
 # This file is part of Autoconf.                       -*- Autoconf -*-
 # Parameterizing and creating config.status.
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -635,7 +635,10 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 :t
 [/@[a-zA-Z_][a-zA-Z_0-9]*@/!b]
 dnl configure_input is a somewhat special, so we don't call AC_SUBST_TRACE.
-s&@configure_input@&$configure_input&;t t
+dnl Note if you change the s||| delimiter here, don't forget to adjust
+dnl ac_sed_conf_input accordingly.  Using & is a bad idea if & appears in
+dnl the replacement string.
+s|@configure_input@|$ac_sed_conf_input|;t t
 dnl During the transition period, this is a special case:
 s&@top_builddir@&$ac_top_builddir_sub&;t t[]AC_SUBST_TRACE([top_builddir])
 dnl For this substitution see the witness macro _AC_HAVE_TOP_BUILD_PREFIX above.
@@ -1655,6 +1658,13 @@ do
       configure_input="$ac_file.  $configure_input"
       AC_MSG_NOTICE([creating $ac_file])
     fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`AS_ECHO(["$configure_input"]) |
+       sed 's/[[\\\\&|]]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
 
     case $ac_tag in
     *:-:* | *:-) cat >"$tmp/stdin" \