about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2013-10-10 17:12:50 +0100
committerPeter Stephenson <pws@zsh.org>2013-10-10 17:12:50 +0100
commit68a9bab11da470275fb28bea19e34db51a5093ba (patch)
treeb419ede8426eee741667905f7d134cd5ca996519
parentdc272d0d14b126ee445c39d1de3962524930fb70 (diff)
downloadzsh-68a9bab11da470275fb28bea19e34db51a5093ba.tar.gz
zsh-68a9bab11da470275fb28bea19e34db51a5093ba.tar.xz
zsh-68a9bab11da470275fb28bea19e34db51a5093ba.zip
31809: Make whitespace clear in trace output for patterns.
-rw-r--r--ChangeLog5
-rw-r--r--Src/exec.c13
2 files changed, 18 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index da52f2a9d..25fb77933 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-10-10  Peter Stephenson  <p.stephenson@samsung.com>
+
+	* 31809: Src/exec.c: make whitespace clear in trace output for
+	patterns.
+
 2013-10-08  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
 	* Eric Cook: 31801: Completion/Linux/Command/_btrfs: some
diff --git a/Src/exec.c b/Src/exec.c
index 1c44565f9..de1b4848e 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -1845,9 +1845,22 @@ quote_tokenized_output(char *str, FILE *file)
 	case '*':
 	case '?':
 	case '$':
+	case ' ':
 	    putc('\\', file);
 	    break;
 
+	case '\t':
+	    fputs("$'\\t'", file);
+	    continue;
+
+	case '\n':
+	    fputs("$'\\n'", file);
+	    continue;
+
+	case '\r':
+	    fputs("$'\\r'", file);
+	    continue;
+
 	case '=':
 	    if (s == str)
 		putc('\\', file);