diff options
author | Joe Rayhawk <jrayhawk@fairlystable.org> | 2025-04-30 02:07:56 -0700 |
---|---|---|
committer | Joe Rayhawk <jrayhawk@fairlystable.org> | 2025-04-30 02:07:56 -0700 |
commit | 26e09889646be3ea65b4a3dfeda26213e4bb6a27 (patch) | |
tree | 4f3c73a9416bf47ad7e125383d23cf42879e38d7 /Src/text.c | |
parent | 841bce705a58b04220b1f257abcc00ae71cbdbdc (diff) | |
parent | 001cba48ce3b964cf01fb3e2af54b20eacbc9bf5 (diff) | |
download | zsh-26e09889646be3ea65b4a3dfeda26213e4bb6a27.tar.gz zsh-26e09889646be3ea65b4a3dfeda26213e4bb6a27.zip |
Merge branch 'upstream' into debian
Diffstat (limited to 'Src/text.c')
-rw-r--r-- | Src/text.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/Src/text.c b/Src/text.c index 5cd7685fd..8b1bd96b6 100644 --- a/Src/text.c +++ b/Src/text.c @@ -335,7 +335,7 @@ getjobtext(Eprog prog, Wordcode c) tlim = tptr + JOBTEXTSIZE - 1; tjob = 1; gettext2(&s); - if (tptr[-1] == Meta) + if (tptr > jbuf && tptr[-1] == Meta) --tptr; *tptr = '\0'; freeeprog(prog); /* mark as unused */ @@ -578,11 +578,16 @@ gettext2(Estate state) Wordcode end = p + WC_FUNCDEF_SKIP(code); int nargs = *state->pc++; + if (nargs > 1) + taddstr("function "); taddlist(state, nargs); if (nargs) taddstr(" "); if (tjob) { - taddstr("() { ... }"); + if (nargs > 1) + taddstr("{ ... }"); + else + taddstr("() { ... }"); state->pc = end; if (!nargs) { /* @@ -594,7 +599,10 @@ gettext2(Estate state) } stack = 1; } else { - taddstr("() {"); + if (nargs > 1) + taddstr("{"); + else + taddstr("() {"); tindent++; taddnl(1); n = tpush(code, 1); |