From: Denys Vlasenko Date: Sun, 16 Feb 2020 17:57:53 +0000 (+0100) Subject: ash: main: Print \n upon EOF (CTRL-D) when run interactively X-Git-Tag: 1_32_0~74 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=226b8a143d5632180bef05f728bb497b8318294f;p=oweals%2Fbusybox.git ash: main: Print \n upon EOF (CTRL-D) when run interactively Upstream comment: Date: Fri, 7 Sep 2018 10:34:14 +0200 main: Print \n upon EOF (CTRL-D) when run interactively 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 Signed-off-by: Jonathan Nieder [reworded the patch description] Signed-off-by: Andrej Shadura Bug-Debian: http://bugs.debian.org/476422 Signed-off-by: Herbert Xu Signed-off-by: Denys Vlasenko --- diff --git a/shell/ash.c b/shell/ash.c index 138f19abd..3958db123 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -13302,8 +13302,12 @@ cmdloop(int top) if (!top || numeof >= 50) break; if (!stoppedjobs()) { - if (!Iflag) + if (!Iflag) { + if (iflag) { + newline_and_flush(stderr); + } break; + } out2str("\nUse \"exit\" to leave shell.\n"); } numeof++;