autoconf-commit
[Top][All Lists]
Advanced

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

[SCM] GNU Autoconf source repository branch, master, updated. v2.65-107-


From: Eric Blake
Subject: [SCM] GNU Autoconf source repository branch, master, updated. v2.65-107-ga20b49a
Date: Fri, 02 Jul 2010 16:39:11 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Autoconf source repository".

http://git.sv.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=a20b49a348ad3be3e56fba66b1a290590e41f41f

The branch, master has been updated
       via  a20b49a348ad3be3e56fba66b1a290590e41f41f (commit)
      from  7eccc094e839b50cb3f95ef8650c5a9def116749 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit a20b49a348ad3be3e56fba66b1a290590e41f41f
Author: Stefano Lattarini <address@hidden>
Date:   Fri Jul 2 18:14:52 2010 +0200

    Describe a Solaris /bin/sh bug w.r.t. for loops.
    
    * doc/autoconf.texi (Limitations of Shell Builtins) <for>:
    Document a bug of the 'for' builtin in Solaris /bin/sh, w.r.t.
    tokens seeming variable assignment in the list of arguments.
    
    Signed-off-by: Eric Blake <address@hidden>

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog         |   10 ++++++++++
 doc/autoconf.texi |   38 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 48 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c742adb..11de524 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2010-07-02  Stefano Lattarini  <address@hidden>
+           Eric Blake  <address@hidden>
+
+       Describe a Solaris /bin/sh bug w.r.t. for loops.
+       * doc/autoconf.texi (Limitations of Shell Builtins) <for>:
+       Document a bug of the 'for' builtin in Solaris /bin/sh, w.r.t.
+       tokens seeming variable assignment in the list of arguments.
+       Report and final patch by Stefano Lattarini, useful suggestions
+       by Eric Blake.
+
 2010-06-23  Ralf Wildenhues  <address@hidden>
 
        Improve VPATH handling in config.status for non-Automake projects.
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index 34ae872..561fae8 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -16703,6 +16703,44 @@ But keep in mind that Zsh, even in Bourne shell 
emulation mode, performs
 word splitting on @address@hidden"$@@"@}}; see @ref{Shell Substitutions},
 item @samp{$@@}, for more.
 
+In Solaris @command{/bin/sh}, when the list of arguments of a
address@hidden loop starts with @emph{unquoted} tokens looking like
+variable assignments, the loop is not executed on that tokens:
+
address@hidden
+$ @kbd{/bin/sh -c 'for v in a=b; do echo "$v"; done'}
+$ @kbd{/bin/sh -c 'for v in a=b d=c; do echo "$v"; done'}
+$ @kbd{/bin/sh -c 'for v in a=b x; do echo "$v"; done'}
+x
address@hidden example
+
address@hidden
+Quoting the "assignment-like" tokens, or preceding them with "normal"
+tokens, solves the problem:
+
address@hidden
+$ @kbd{/bin/sh -c 'for v in "a=b"; do echo "$v"; done'}
+a=b
+$ @kbd{/bin/sh -c 'for v in x a=b; do echo "$v"; done'}
+x
+a=b
+$ @kbd{/bin/sh -c 'for v in x a=b d=c; do echo "$v"; done'}
+x
+a=b
+c=d
address@hidden example
+
address@hidden
+Luckily enough, the bug is not triggered if the "assignment-like"
+tokens are the results of a variable expansion (even unquoted):
+
address@hidden
+$ @kbd{/bin/sh -c 'x="a=b"; for v in $x; do echo "$v"; done'}
+a=b
address@hidden example
+
address@hidden
+So, at least, the bug should be easy to grep for and to avoid.
 
 @anchor{if}
 @item @command{if}


hooks/post-receive
-- 
GNU Autoconf source repository



reply via email to

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