aboutsummaryrefslogtreecommitdiff
path: root/cmdedit.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-04-23 15:28:28 +0000
committerEric Andersen <andersen@codepoet.org>2001-04-23 15:28:28 +0000
commited424dbf1d3d4f0448b9bfdc6b6128d4c90514ee (patch)
tree5b613c1439ae5bb391a398d5f5a0f011d4da9215 /cmdedit.c
parentd8862928c25be9b00f6755cf445773cd1e4cc22a (diff)
downloadbusybox-ed424dbf1d3d4f0448b9bfdc6b6128d4c90514ee.tar.gz
Some patches from Gennady Feldman. Fixed a glob problem such that
'ls *.h Config.h' works. Fixed a silly typo with fg/bg process control. Made cmdedit exit sanely when it cannot read input.
Diffstat (limited to 'cmdedit.c')
-rw-r--r--cmdedit.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/cmdedit.c b/cmdedit.c
index eef1a88c8..ce5450032 100644
--- a/cmdedit.c
+++ b/cmdedit.c
@@ -1211,7 +1211,8 @@ extern void cmdedit_read_input(char *prompt, char command[BUFSIZ])
fflush(stdout); /* buffered out to fast */
if (read(inputFd, &c, 1) < 1)
- return;
+ /* if we can't read input then exit */
+ goto prepare_to_die;
switch (c) {
case '\n':
@@ -1243,6 +1244,7 @@ extern void 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) {
+prepare_to_die:
printf("exit");
clean_up_and_die(0);
} else {