about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorMikael Magnusson <mikachu@gmail.com>2022-03-08 19:34:20 +0100
committerMikael Magnusson <mikachu@gmail.com>2022-03-30 08:07:39 +0200
commitd7b8619396d806d390126c2abd1c3ce099fe7f59 (patch)
tree69d35674d1901f992dc33187e6ce9a010908b863 /Src
parent3bf95b91f0cd378c1a4e9c611a51cb9fe0e2ffcd (diff)
downloadzsh-d7b8619396d806d390126c2abd1c3ce099fe7f59.tar.gz
zsh-d7b8619396d806d390126c2abd1c3ce099fe7f59.tar.xz
zsh-d7b8619396d806d390126c2abd1c3ce099fe7f59.zip
49813: <<<: Document newline behavior and fix optimization
The =(<<<foo) optimization forgot to add a newline, but =(cat<<<foo)
always did, make the behavior consistent, and document it.
Diffstat (limited to 'Src')
-rw-r--r--Src/exec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Src/exec.c b/Src/exec.c
index f67074846..70cbfc97f 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -4836,8 +4836,10 @@ getoutputfile(char *cmd, char **eptr)
 	singsub(&s);
 	if (errflag)
 	    s = NULL;
-	else
+	else {
 	    untokenize(s);
+	    s = dyncat(s, "\n");
+	}
     }
 
     if (!s)             /* Unclear why we need to do this before open() */