diff options
| author | Peter Stephenson <pws@zsh.org> | 2018-02-12 10:06:45 +0000 |
|---|---|---|
| committer | Peter Stephenson <pws@zsh.org> | 2018-02-12 10:06:45 +0000 |
| commit | 47aa60950c488a49dc245659c126e3078bf499d0 (patch) | |
| tree | 6429d9a55a7e17584fce5186de8a592f9729166b /Src/exec.c | |
| parent | 42324: _git: handle mutually exclusive options (diff) | |
| download | zsh-47aa60950c488a49dc245659c126e3078bf499d0.tar zsh-47aa60950c488a49dc245659c126e3078bf499d0.tar.gz zsh-47aa60950c488a49dc245659c126e3078bf499d0.tar.bz2 zsh-47aa60950c488a49dc245659c126e3078bf499d0.tar.lz zsh-47aa60950c488a49dc245659c126e3078bf499d0.tar.xz zsh-47aa60950c488a49dc245659c126e3078bf499d0.tar.zst zsh-47aa60950c488a49dc245659c126e3078bf499d0.zip | |
42355: Fix use of backslashes on here doc input.
Handling of white space in particular was confusing and inconsistent
with other shells.
Diffstat (limited to 'Src/exec.c')
| -rw-r--r-- | Src/exec.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Src/exec.c b/Src/exec.c index c39680de7..e5c64555c 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -4387,8 +4387,17 @@ gethere(char **strp, int typ) bptr = buf + bsiz; bsiz *= 2; } - if (lexstop || c == '\n') + if (lexstop) break; + if (c == '\n') { + if (!qt && bptr > t && *(bptr - 1) == '\\') { + /* line continuation */ + bptr--; + c = hgetc(); + continue; + } else + break; + } *bptr++ = c; c = hgetc(); } |
