mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-05-20 23:41:27 +02:00
52482: strip trailing newlines in emulation modes of ${ command; }
This commit is contained in:
parent
0fccdf0d57
commit
b3e763cc22
2 changed files with 9 additions and 0 deletions
|
@ -1,5 +1,8 @@
|
|||
2024-01-24 Bart Schaefer <schaefer@zsh.org>
|
||||
|
||||
* 52482: Src/subst.c: strip trailing newlines in emulation modes
|
||||
of ${ command; }, for bash/ksh compatibility
|
||||
|
||||
* 52476 + cf. 52479: Etc/FAQ.yo: more about nofork substitution
|
||||
|
||||
* 52477: Src/Modules/curses.c: fix "zcurses mouse delay ..."
|
||||
|
|
|
@ -2005,6 +2005,12 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags,
|
|||
int onoerrs = noerrs, rplylen;
|
||||
noerrs = 2;
|
||||
rplylen = zstuff(&cmdarg, rplytmp);
|
||||
if (! EMULATION(EMULATE_ZSH)) {
|
||||
/* bash and ksh strip trailing newlines here */
|
||||
while (rplylen > 0 && cmdarg[rplylen-1] == '\n')
|
||||
rplylen--;
|
||||
cmdarg[rplylen] = 0;
|
||||
}
|
||||
noerrs = onoerrs;
|
||||
if (rplylen >= 0)
|
||||
setsparam("REPLY", metafy(cmdarg, rplylen, META_REALLOC));
|
||||
|
|
Loading…
Reference in a new issue