about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2013-09-06 14:09:08 +0100
committerPeter Stephenson <pws@zsh.org>2013-09-06 14:09:08 +0100
commit3573ab44e7a041f83dab1dc56ed0b77b8d18d996 (patch)
treefe9921fe36c38c639a03b11ae74e71104729fe0c
parent2afa556d8fd6b365e518ef754fc34f0ffb6854ff (diff)
downloadzsh-3573ab44e7a041f83dab1dc56ed0b77b8d18d996.tar.gz
zsh-3573ab44e7a041f83dab1dc56ed0b77b8d18d996.tar.xz
zsh-3573ab44e7a041f83dab1dc56ed0b77b8d18d996.zip
31658: fix manual entry about getting lines from mapfile
-rw-r--r--ChangeLog5
-rw-r--r--Doc/Zsh/mod_mapfile.yo9
2 files changed, 11 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 6c3771271..72fc65195 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,11 @@
 	can hear if you shriek.  Treat exclamation marks as strings in
 	"! -a ..." and "! -o ...".
 
+2013-09-02  Peter Stephenson  <p.stephenson@samsung.com>
+
+	* 31685: Doc/Zsh/mod_mapfile.yo: documentation of how to get
+	lines from a file is not correct.
+
 2013-08-29  Peter Stephenson  <p.stephenson@samsung.com>
 
 	* users/17955: Doc/Zsh/contrib.yo,
diff --git a/Doc/Zsh/mod_mapfile.yo b/Doc/Zsh/mod_mapfile.yo
index 98114aea2..96e056816 100644
--- a/Doc/Zsh/mod_mapfile.yo
+++ b/Doc/Zsh/mod_mapfile.yo
@@ -28,9 +28,12 @@ referenced may not be written or deleted.
 
 A file may conveniently be read into an array as one line per element
 with the form
-`var(array)tt(=LPAR()"${(f)mapfile[)var(filename)tt(]}"RPAR())'.
-The double quotes are necessary to prevent empty lines from being
-removed.
+`var(array)tt(=LPAR()"${(f@)mapfile[)var(filename)tt(]}"RPAR())'.
+The double quotes and the `tt(@)' are necessary to prevent empty lines
+from being removed.  Note that if the file ends with a newline,
+the shell will split on the final newline, generating an additional
+empty field; this can be suppressed by using
+`var(array)tt(=LPAR()"${(f@)${mapfile[)var(filename)tt(]%$'\n'}}"RPAR())'.
 )
 enditem()