Hello,

On Wed, Mar 15, 2006 at 05:30:43PM +0100, Ralf Wildenhues wrote:
> * Noah Misch wrote on Wed, Mar 15, 2006 at 05:03:57PM CET:

> > > I think setting IFS and unsetting CDPATH is ``sanitizing''.
> > 
> > I agree with this part.
> Agreed.

thank you for your reviews, I wasn't sure about that.

I marginally noticed the problem that

> Before the patch, IFS would be sanitized only after the first path walk

... but wasn't able to see the consequences.

> Second, your change to _AC_CANONICAL_SPLIT 

... would re-introduce an old bug.
Thank you, Ralf, for both explanations; I distilled them to two terse
comments, which I engraved there for future generations.

> > > And I think the stack of depth 1 (as_save_IFS) has no practical value;

> > [...] one-level preservation is not so bad. [...] this patch can only
> > break existing uses.  [...] let us forgot this change.

OK, let's forgot about it.

I committed the patch as attached here.

Have a nice day,
        Stepan
2006-03-16  Stepan Kasal  <[EMAIL PROTECTED]>

        * lib/m4sugar/m4sh.m4 (_AS_PREPARE): Move the IFS setup and CDPATH
          sanitizing...
        (AS_SHELL_SANITIZE): ...here; mention _AS_PATH_WALK needs IFS set.
        * lib/autoconf/general.m4 (_AC_CANONICAL_SPLIT): Add an explanation
          why IFS is restored so late; thank you, Ralf, for reminding us.
        
Index: lib/autoconf/general.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/general.m4,v
retrieving revision 1.890
diff -u -r1.890 general.m4
--- lib/autoconf/general.m4     21 Feb 2006 07:16:33 -0000      1.890
+++ lib/autoconf/general.m4     16 Mar 2006 13:19:00 -0000
@@ -1664,6 +1664,7 @@
 AC_SUBST([$1_cpu], [$[1]])dnl
 AC_SUBST([$1_vendor], [$[2]])dnl
 shift; shift
+[# Remember, the first character of IFS is used to create $]*:
 AC_SUBST([$1_os], [$[*]])dnl
 IFS=$ac_save_IFS
 ])# _AC_CANONICAL_SPLIT
Index: lib/m4sugar/m4sh.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/m4sugar/m4sh.m4,v
retrieving revision 1.161
diff -u -r1.161 m4sh.m4
--- lib/m4sugar/m4sh.m4 14 Mar 2006 07:18:18 -0000      1.161
+++ lib/m4sugar/m4sh.m4 16 Mar 2006 13:19:02 -0000
@@ -326,6 +326,14 @@
 _AS_PATH_SEPARATOR_PREPARE
 _AS_UNSET_PREPARE
 
+# IFS
+# We need space, tab and new line, in precisely that order.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS="  $as_nl"
+
 # Find who we are.  Look in the path if we contain no path at all
 # relative or not.
 case $[0] in
@@ -371,6 +379,8 @@
 # Name of the executable.
 as_me=`AS_BASENAME("$[0]")`
 
+# CDPATH.
+$as_unset CDPATH
 ])
 
 
@@ -396,15 +406,6 @@
 _AS_TEST_PREPARE
 _AS_TR_CPP_PREPARE
 _AS_TR_SH_PREPARE
-
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS="  $as_nl"
-
-# CDPATH.
-$as_unset CDPATH
 ])
 
 

Reply via email to