From e07dda2d4861649c75952ef76d06c60732d53cd4 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 31 May 2006 19:49:15 +0000 Subject: [PATCH] * lib/autoconf/general.m4 (_AC_DO_ECHO): Be even more conservative about quoting the case statement, just in case. * doc/autoconf.texi (Particular Programs) : Document that ${MKDIR_P} understands --. * lib/autoconf/programs.m4 (AC_PROG_MKDIR_P): Improve the comment. --- ChangeLog | 12 ++++++++++++ doc/autoconf.texi | 10 +++++++--- lib/autoconf/general.m4 | 11 +++++++++-- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8224471d..71ebc4b7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2006-05-31 Paul Eggert + + * lib/autoconf/general.m4 (_AC_DO_ECHO): Be even more conservative + about quoting the case statement, just in case. + +2006-05-31 Stepan Kasal + + * doc/autoconf.texi (Particular Programs) : + Document that ${MKDIR_P} understands --. + * lib/autoconf/programs.m4 (AC_PROG_MKDIR_P): Improve the + comment. + 2006-05-31 Ralf Wildenhues * lib/m4sugar/m4sh.m4 (_AS_DIRNAME_PREPARE): Guard against test diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 2afd9ab2..59cb55db 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -3546,8 +3546,10 @@ This macro is related to the @code{AS_MKDIR_P} macro (@pxref{Programming in M4sh}), but it sets an output variable intended for use in other files, whereas @code{AS_MKDIR_P} is intended for use in scripts like @command{configure}. Also, @code{AS_MKDIR_P} does not accept options, -but @code{MKDIR_P} can use the @option{-m} option, e.g., a makefile might -invoke @code{$(MKDIR_P) -m 0 dir} to create an inaccessible directory. +but @code{MKDIR_P} supports the @option{-m} option, e.g., a makefile +might invoke @code{$(MKDIR_P) -m 0 dir} to create an inaccessible +directory, and conversely a makefile should use @code{$(MKDIR_P) -- +$(FOO)} if @var{FOO} might yield a value that begins with @samp{-}. Finally, @code{AS_MKDIR_P} does not check for race condition vulnerability, whereas @code{AC_PROG_MKDIR_P} does. @end defmac @@ -10796,7 +10798,9 @@ expansion @code{$@{var@}} that crosses a 1024- or 4096-byte buffer boundary within a here-document. If the closing brace does not lie on the boundary, the failure is silent and the variable expansion will be empty, otherwise the shell will report a bad substitution. This bug can usually be worked -around by omitting the braces: @code{$var}. +around by omitting the braces: @code{$var}. The bug was fixed in +@samp{ksh99g} (1998-04-30) but as of 2006 many operating systems were +still shipping older versions with the bug. Some shells can be extremely inefficient when there are a lot of here-documents inside a single statement. For instance if your diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index 404891bc..ec4039da 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -2152,11 +2152,18 @@ AC_DEFUN([_AC_DO_ECHO], dnl If the string contains '"', '`', or '\', then just echo it rather dnl than expanding it. This is a hack, but it is safer, while also dnl typically expanding simple substrings like '$CC', which is what we want. +dnl dnl The rest of this macro body is quoted, to work around misuses like dnl `AC_CHECK_FUNC(sigblock, , AC_CHECK_LIB(bsd, sigblock))', dnl which underquotes the 3rd arg and would misbehave if we didn't quote here. -[case $ac_try in #( - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; #( +dnl The "(($ac_try" instead of $ac_try avoids problems with even-worse +dnl underquoting misuses, such as +dnl `AC_CHECK_FUNC(foo, , AC_CHECK_LIB(a, foo, , AC_CHECK_LIB(b, foo)))'. +dnl We normally wouldn't bother with this kind of workaround for invalid code +dnl but this change was put in just before Autoconf 2.60 and we wanted to +dnl minimize the integration hassle. +[case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\""]]) -- 2.11.4.GIT