mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-09-28 06:49:49 +02:00
47201: fix 42355 for multiple backslashes
This commit is contained in:
parent
2d3b3510a8
commit
f7519811e1
@ -1,3 +1,7 @@
|
||||
2018-04-29 Barton E. Schaefer <schaefer@zsh.org>
|
||||
|
||||
* Ricardo Giorni: 47201: fix 42355 for multiple backslashes
|
||||
|
||||
2018-04-26 Peter Stephenson <p.stephenson@samsung.com>
|
||||
|
||||
* c.f. 42726: Test/W02jobs.ztst: Back off fg and bg tests as they
|
||||
|
12
Src/exec.c
12
Src/exec.c
@ -4435,16 +4435,16 @@ gethere(char **strp, int typ)
|
||||
bptr = buf + bsiz;
|
||||
bsiz *= 2;
|
||||
}
|
||||
if (lexstop)
|
||||
if (lexstop || c == '\n')
|
||||
break;
|
||||
if (c == '\n') {
|
||||
if (!qt && bptr > t && *(bptr - 1) == '\\') {
|
||||
/* line continuation */
|
||||
if (!qt && c == '\\') {
|
||||
*bptr++ = c;
|
||||
c = hgetc();
|
||||
if (c == '\n') {
|
||||
bptr--;
|
||||
c = hgetc();
|
||||
continue;
|
||||
} else
|
||||
break;
|
||||
}
|
||||
}
|
||||
*bptr++ = c;
|
||||
c = hgetc();
|
||||
|
@ -174,6 +174,30 @@
|
||||
>some stuff
|
||||
>to test
|
||||
>tab\stripping
|
||||
>Last line
|
||||
|
||||
heretest() {
|
||||
print First line
|
||||
cat <<-HERE
|
||||
$foo\\
|
||||
$foo
|
||||
some\\ \
|
||||
stuff
|
||||
to\
|
||||
test \\
|
||||
more backslash craziness\\\\\\\\\
|
||||
wild
|
||||
HERE
|
||||
print Last line
|
||||
}
|
||||
heretest
|
||||
0:No line continuation in here-document on escaped backslash
|
||||
>First line
|
||||
>bar\
|
||||
>bar
|
||||
>some\ stuff
|
||||
>to test \
|
||||
>more backslash craziness\\\\ wild
|
||||
>Last line
|
||||
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user