]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Add recommendation on (not) unsetting IFS.
authorPaolo Bonzini <bonzini@gnu.org>
Thu, 21 Jan 2010 11:16:42 +0000 (12:16 +0100)
committerPaolo Bonzini <bonzini@gnu.org>
Thu, 21 Jan 2010 11:16:42 +0000 (12:16 +0100)
* doc/autoconf.texi (Special shell variables): Explain why it's
better not to unset IFS.

ChangeLog
doc/autoconf.texi

index eaee96bf6006d733fc8dfc2d78de2f797edf3cc9..70432f8a7a506303070cd3878c3353c70b667402 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-01-20  Paolo Bonzini  <bonzini@gnu.org>
+
+       Add recommendation on (not) unsetting IFS.
+       * doc/autoconf.texi (Special shell variables): Explain why it's
+       better not to unset IFS.
+
 2010-01-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        config.status: consistent exit status with nonexistent config file input.
index 1549f89555071b84d9bfd06b1a1b90996b5bd5e1..e5cf9fd6f0f65f542caacd648d7de2b5a21f1a68 100644 (file)
@@ -15750,6 +15750,22 @@ environment variables be set to @samp{C} if the C locale is desired;
 @file{configure} scripts and M4sh do that for you.
 Export these variables after setting them.
 
+Unsetting @code{IFS} instead of resetting it to the default sequence
+is not suggested, since code that tries to save and restore the
+variable's value will incorrectly reset it to an empty value, thus
+disabling field splitting:
+
+@example
+unset IFS
+# default separators used for field splitting
+
+save_IFS=$IFS
+IFS=:
+# ...
+IFS=$save_IFS
+# no field splitting performed
+@end example
+
 @c  However, some older, nonstandard
 @c  systems (notably @acronym{SCO}) break if locale environment variables
 @c  are set to @samp{C}, so when running on these systems