mirror of
git://git.code.sf.net/p/zsh/code
synced 2026-01-02 08:21:09 +01:00
36399: Shell code text with multiple here documents wasn't shown properly.
This commit is contained in:
parent
8e3ca08f13
commit
0e63286bd4
3 changed files with 38 additions and 2 deletions
|
|
@ -1,3 +1,8 @@
|
|||
2015-09-02 Peter Stephenson <p.stephenson@samsung.com>
|
||||
|
||||
* 36399: Src/text.c, Test/A04redirect.ztst: shell code with
|
||||
multiple here documents wasn't shown properly.
|
||||
|
||||
2015-09-01 Mikael Magnusson <mikachu@gmail.com>
|
||||
|
||||
* 36380: Src/utils.c: Avoid gcc case syntax
|
||||
|
|
|
|||
|
|
@ -77,8 +77,8 @@ taddpending(char *str1, char *str2)
|
|||
*/
|
||||
if (tpending) {
|
||||
int oldlen = strlen(tpending);
|
||||
tpending = zrealloc(tpending, len + oldlen);
|
||||
sprintf(tpending + oldlen, "%s%s", str1, str2);
|
||||
tpending = zrealloc(tpending, len + oldlen + 1);
|
||||
sprintf(tpending + oldlen, "\n%s%s", str1, str2);
|
||||
} else {
|
||||
tpending = (char *)zalloc(len);
|
||||
sprintf(tpending, "%s%s", str1, str2);
|
||||
|
|
|
|||
|
|
@ -555,3 +555,34 @@
|
|||
0:Assignment with exec used for redirection: POSIX_BUILTINS
|
||||
>x=And this
|
||||
?This should appear, too
|
||||
|
||||
fn-two-heres() {
|
||||
# tabs below
|
||||
cat <<-x <<-y
|
||||
foo
|
||||
x
|
||||
bar
|
||||
y
|
||||
}
|
||||
which -x2 fn-two-heres
|
||||
fn-two-heres
|
||||
eval "$(which -x2 fn-two-heres)"
|
||||
fn-two-heres
|
||||
print $functions[fn-two-heres]
|
||||
0:Two here-documents in a line are shown correctly.
|
||||
>fn-two-heres () {
|
||||
> cat <<x <<y
|
||||
>foo
|
||||
>x
|
||||
>bar
|
||||
>y
|
||||
>}
|
||||
>foo
|
||||
>bar
|
||||
>foo
|
||||
>bar
|
||||
> cat <<x <<y
|
||||
>foo
|
||||
>x
|
||||
>bar
|
||||
>y
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue