about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2012-09-08 19:19:06 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2012-09-08 19:19:06 +0000
commitdd3a8ead160eaf3ae689529b7e5c1ea797c0cc77 (patch)
tree4b48fa1690d9e8c9c075b967441739967dabb5cb
parent361e1716729a34d19aa8bace4e6be44c295c3e1d (diff)
downloadzsh-dd3a8ead160eaf3ae689529b7e5c1ea797c0cc77.tar.gz
zsh-dd3a8ead160eaf3ae689529b7e5c1ea797c0cc77.tar.xz
zsh-dd3a8ead160eaf3ae689529b7e5c1ea797c0cc77.zip
users/17236: r and other fc output didn't metafy when listing to a file
other than stdout
-rw-r--r--ChangeLog7
-rw-r--r--Doc/META-FAQ.yo2
-rw-r--r--Src/builtin.c8
3 files changed, 13 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index a546a3f50..eecf65d42 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-09-08  Peter Stephenson  <p.w.stephenson@ntlworld.com>
+
+	* users/17236: Src/builtin.c: r and other fc output didn't
+	unmetafy when listing to a file other than stdout.
+
 2012-09-06  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
 	* 30656: Src/math.c: treat dividing by -1 the same as
@@ -142,5 +147,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.5716 $
+* $Revision: 1.5717 $
 *****************************************************
diff --git a/Doc/META-FAQ.yo b/Doc/META-FAQ.yo
index bfdb76b77..642f4c3b3 100644
--- a/Doc/META-FAQ.yo
+++ b/Doc/META-FAQ.yo
@@ -12,7 +12,7 @@ def(texinode)(4)(DELLINE)
 def(cindex)(1)(DELLINE)
 
 def(sect)(1)(
-SECTHEAD
+SECTHEAD+CHAR(10)
 ARG1
 )
 
diff --git a/Src/builtin.c b/Src/builtin.c
index 3925edd10..d8493bb8a 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -1727,8 +1727,12 @@ fclist(FILE *f, Options ops, zlong first, zlong last,
 	    if (f == stdout) {
 		nicezputs(s, f);
 		putc('\n', f);
-	    } else
-		fprintf(f, "%s\n", s);
+	    } else {
+		int len;
+		unmetafy(s, &len);
+		fwrite(s, 1, len, f);
+		putc('\n', f);
+	    }
 	}
 	/* move on to the next history line, or quit the loop */
 	if (first < last) {