]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Document here-doc pitfall.
authorEric Blake <ebb9@byu.net>
Wed, 13 Jan 2010 13:03:07 +0000 (06:03 -0700)
committerEric Blake <ebb9@byu.net>
Wed, 13 Jan 2010 13:10:31 +0000 (06:10 -0700)
* doc/autoconf.texi (Here-Documents): Mention problem with <<-
operator.
Reported by Jim Meyering.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
doc/autoconf.texi

index 6b6fd808d3f8f0ae413235b13438705b76acfea8..3fa0c5d78be76edf4806e036f13b3c4cf342451f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-01-13  Eric Blake  <ebb9@byu.net>
+
+       Document here-doc pitfall.
+       * doc/autoconf.texi (Here-Documents): Mention problem with <<-
+       operator.
+       Reported by Jim Meyering.
+
 2010-01-12  Eric Blake  <ebb9@byu.net>
 
        Typo fix in earlier commit.
index ce6ac88fe32246b4156dd322d747481d43d78904..31550fd5a98a65a95460270fbfbe700c0718a3a1 100644 (file)
@@ -14691,6 +14691,22 @@ macro when it was expanded before in a conditional path, and the
 condition turned out to be false at runtime, and we end up not
 executing the macro at all.
 
+Be careful with the use of @samp{<<-} to unindent here-documents.  The
+behavior is only portable for stripping leading @key{TAB}s, and things
+can silently break if an overzealous editor converts to using leading
+spaces (not all shells are nice enough to warn about unterminated
+here-documents).
+
+@example
+$ @kbd{printf 'cat <<-x\n\t1\n\t 2\n\tx\n' | bash && echo oops}
+1
+ 2
+$ @kbd{printf 'cat <<-x\n 1\n  2\n x\n' | bash-3.2 && echo oops}
+ 1
+  2
+ x
+@end example
+
 @node File Descriptors
 @section File Descriptors
 @cindex Descriptors