summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shell/ash.c2
-rw-r--r--shell/cmdedit.c1
2 files changed, 2 insertions, 1 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 6d1dc60..6c6c286 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -6062,7 +6062,7 @@ retry:
}
goto retry;
}
- if(nr < 0) {
+ if(nr < 0 && errno == 0) {
/* Ctrl+D presend */
nr = 0;
}
diff --git a/shell/cmdedit.c b/shell/cmdedit.c
index 25d31a0..56b789a 100644
--- a/shell/cmdedit.c
+++ b/shell/cmdedit.c
@@ -1297,6 +1297,7 @@ int cmdedit_read_input(char *prompt, char command[BUFSIZ])
/* Control-d -- Delete one character, or exit
* if the len=0 and no chars to delete */
if (len == 0) {
+ errno = 0;
prepare_to_die:
#if !defined(CONFIG_ASH)
printf("exit");