diff options
| author | Eric Andersen <andersen@codepoet.org> | 2001-05-31 17:17:12 +0000 |
|---|---|---|
| committer | Eric Andersen <andersen@codepoet.org> | 2001-05-31 17:17:12 +0000 |
| commit | 4f6753e586dba5e6c240e670d41fc8fd011034e1 (patch) | |
| tree | 88ee74a45ccdff717c60b3c722c94e2e2801b843 /shell | |
| parent | 4f990533e35b75a89f6ec86d9835e97ea5aafaa0 (diff) | |
| download | busybox-w32-4f6753e586dba5e6c240e670d41fc8fd011034e1.tar.gz busybox-w32-4f6753e586dba5e6c240e670d41fc8fd011034e1.tar.bz2 busybox-w32-4f6753e586dba5e6c240e670d41fc8fd011034e1.zip | |
Cope gracefully when people type something, then hit ^C.
-Erik
Diffstat (limited to 'shell')
| -rw-r--r-- | shell/hush.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/shell/hush.c b/shell/hush.c index 5c129ce17..372c95753 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
| @@ -891,6 +891,7 @@ static void get_user_input(struct in_str *i) | |||
| 891 | the_command[0]=fgetc(i->file); | 891 | the_command[0]=fgetc(i->file); |
| 892 | the_command[1]='\0'; | 892 | the_command[1]='\0'; |
| 893 | #endif | 893 | #endif |
| 894 | fflush(stdout); | ||
| 894 | i->p = the_command; | 895 | i->p = the_command; |
| 895 | } | 896 | } |
| 896 | 897 | ||
| @@ -908,7 +909,9 @@ static int file_get(struct in_str *i) | |||
| 908 | /* need to double check i->file because we might be doing something | 909 | /* need to double check i->file because we might be doing something |
| 909 | * more complicated by now, like sourcing or substituting. */ | 910 | * more complicated by now, like sourcing or substituting. */ |
| 910 | if (i->__promptme && interactive && i->file == stdin) { | 911 | if (i->__promptme && interactive && i->file == stdin) { |
| 911 | get_user_input(i); | 912 | while(! i->p || (interactive && strlen(i->p)==0) ) { |
| 913 | get_user_input(i); | ||
| 914 | } | ||
| 912 | i->promptmode=2; | 915 | i->promptmode=2; |
| 913 | i->__promptme = 0; | 916 | i->__promptme = 0; |
| 914 | if (i->p && *i->p) { | 917 | if (i->p && *i->p) { |
