aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-05-31 17:17:12 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-05-31 17:17:12 +0000
commit36bc4bcd564d935828df0cb4c8b88ab245fc3b69 (patch)
tree88ee74a45ccdff717c60b3c722c94e2e2801b843 /shell
parent89689731603e63d490e38acdf44707624876224f (diff)
downloadbusybox-w32-36bc4bcd564d935828df0cb4c8b88ab245fc3b69.tar.gz
busybox-w32-36bc4bcd564d935828df0cb4c8b88ab245fc3b69.tar.bz2
busybox-w32-36bc4bcd564d935828df0cb4c8b88ab245fc3b69.zip
Cope gracefully when people type something, then hit ^C.
-Erik git-svn-id: svn://busybox.net/trunk/busybox@2768 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'shell')
-rw-r--r--shell/hush.c5
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) {