summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Src/text.c12
2 files changed, 12 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 6d2311cf6..47828857b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2001-08-16  Sven Wischnowsky  <wischnow@zsh.org>
 
+	* 15639: Src/text.c: fix bug for output of unquoted here-docs and
+	-strings with special characters
+
 	* 15638: Completion/Base/Completer/_approximate: make sure that
 	there is one of the group-options before using it
 
diff --git a/Src/text.c b/Src/text.c
index 7595c9add..2215b45fd 100644
--- a/Src/text.c
+++ b/Src/text.c
@@ -751,9 +751,15 @@ getredirs(LinkList redirs)
 	    taddstr(fstr[f->type]);
 	    taddchr(' ');
 	    if (f->type == REDIR_HERESTR) {
-		taddchr('\'');
-		taddstr(bslashquote(f->name, NULL, 1));
-		taddchr('\'');
+                if (has_token(f->name)) {
+                    taddchr('\"');
+                    taddstr(bslashquote(f->name, NULL, 2));
+                    taddchr('\"');
+                } else {
+                    taddchr('\'');
+                    taddstr(bslashquote(f->name, NULL, 1));
+                    taddchr('\'');
+                }
 	    } else
 		taddstr(f->name);
 	    taddchr(' ');