about summary refs log tree commit diff
path: root/Src/text.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/text.c')
-rw-r--r--Src/text.c12
1 files changed, 9 insertions, 3 deletions
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(' ');