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>
This commit is contained in:
parent
50a37459ff
commit
f0c0c56e9b
@ -2670,6 +2670,8 @@ static int get_user_input(struct in_str *i)
|
|||||||
}
|
}
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
/* EOF/error detected */
|
/* EOF/error detected */
|
||||||
|
/* ^D on interactive input goes to next line before exiting: */
|
||||||
|
write(STDOUT_FILENO, "\n", 1);
|
||||||
i->p = NULL;
|
i->p = NULL;
|
||||||
i->peek_buf[0] = r = EOF;
|
i->peek_buf[0] = r = EOF;
|
||||||
return r;
|
return r;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user