klibc-bot for Gerrit Pape
2020-Mar-28 21:49 UTC
[klibc] [klibc:update-dash] dash: main: Print \n upon EOF (CTRL-D) when run interactively
Commit-ID: d754d32592fa1c6359b37d101485ced1ff7cdf79 Gitweb: http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=d754d32592fa1c6359b37d101485ced1ff7cdf79 Author: Gerrit Pape <pape at smarden.org> AuthorDate: Fri, 7 Sep 2018 10:34:14 +0200 Committer: Ben Hutchings <ben at decadent.org.uk> CommitDate: Sat, 28 Mar 2020 21:42:55 +0000 [klibc] dash: main: Print \n upon EOF (CTRL-D) when run interactively [ dash commit 413c6dcc3ca3891825ae8239251140882d7c6c6c ] Exiting dash via a ^D instead of with "exit" causes dash to forget to print a newline. sh-3.1$ sh sh-3.1$ ^D sh-3.1$ dash $ sh-3.1$ It is more neat and tidy to send a newline similarly to what bash does, so it doesn't make the next prompt of the parent shell look ugly. Suggested by jidanni. Signed-off-by: Gerrit Pape <pape at smarden.org> Signed-off-by: Jonathan Nieder <jrnieder at gmail.com> [reworded the patch description] Signed-off-by: Andrej Shadura <andrew.shadura at collabora.co.uk> Bug-Debian: http://bugs.debian.org/476422 Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/main.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/usr/dash/main.c b/usr/dash/main.c index e8e42565..6d53e009 100644 --- a/usr/dash/main.c +++ b/usr/dash/main.c @@ -221,8 +221,15 @@ cmdloop(int top) if (!top || numeof >= 50) break; if (!stoppedjobs()) { - if (!Iflag) + if (!Iflag) { + if (iflag) { + out2c('\n'); +#ifdef FLUSHERR + flushout(out2); +#endif + } break; + } out2str("\nUse \"exit\" to leave shell.\n"); } numeof++;
Seemingly Similar Threads
- [klibc:update-dash] dash: eval: Report I/O error on stdout
- [klibc:update-dash] [BUILTIN] Allow return in loop conditional to set exit status
- [klibc:update-dash] dash: [BUILTIN] Allow return in loop conditional to set exit status
- Dovecot and Bogofilter
- [klibc:update-dash] dash: builtin: Default to mktemp, not tempfile