aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2021-04-13 16:42:17 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2021-04-13 16:42:17 +0200
commitf0c0c56e9b67413ef397876e563c14b02a5deb0f (patch)
treec393c0c63d82b336332aa85f13266a53a40b2b60
parent50a37459ff991cab97e7326490d0637ff1106cc8 (diff)
downloadbusybox-w32-f0c0c56e9b67413ef397876e563c14b02a5deb0f.tar.gz
busybox-w32-f0c0c56e9b67413ef397876e563c14b02a5deb0f.tar.bz2
busybox-w32-f0c0c56e9b67413ef397876e563c14b02a5deb0f.zip
hush: beautify ^D handling to match ash / bash
function old new delta fgetc_interactive 227 244 +17 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--shell/hush.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 7cc678f3c..144ad3edd 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -2670,6 +2670,8 @@ static int get_user_input(struct in_str *i)
2670 } 2670 }
2671 if (r < 0) { 2671 if (r < 0) {
2672 /* EOF/error detected */ 2672 /* EOF/error detected */
2673 /* ^D on interactive input goes to next line before exiting: */
2674 write(STDOUT_FILENO, "\n", 1);
2673 i->p = NULL; 2675 i->p = NULL;
2674 i->peek_buf[0] = r = EOF; 2676 i->peek_buf[0] = r = EOF;
2675 return r; 2677 return r;