summaryrefslogtreecommitdiff
path: root/shell/cmdedit.c
diff options
context:
space:
mode:
authorEric Andersen2001-07-17 01:12:36 +0000
committerEric Andersen2001-07-17 01:12:36 +0000
commit044228d5ecb9b79397f9fc915d046cf4538281e2 (patch)
tree4c43e4947b0196d807249f8f6e1c9c679b6bbcde /shell/cmdedit.c
parent51ded05b3bf4df6f126420d39a40d27ea0728aa9 (diff)
downloadbusybox-044228d5ecb9b79397f9fc915d046cf4538281e2.zip
busybox-044228d5ecb9b79397f9fc915d046cf4538281e2.tar.gz
This is vodz' latest patch. Sorry it took so long...
1) ping cleanup (compile fix from this patch already applied). 2) traceroute call not spare ntohl() now (and reduce size); 3) Fix for functions not declared static in insmod, ash, vi and mount. 4) a more simple API cmdedit :)) 5) adds "stopped jobs" warning to ash on Ctrl-D and fixes "ignoreeof" option 6) reduce exporting library function index->strchr (traceroute), bzero->memset (syslogd)
Diffstat (limited to 'shell/cmdedit.c')
-rw-r--r--shell/cmdedit.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/shell/cmdedit.c b/shell/cmdedit.c
index 540eb7e..69f8337 100644
--- a/shell/cmdedit.c
+++ b/shell/cmdedit.c
@@ -1153,7 +1153,8 @@ enum {
*
*/
-extern void cmdedit_read_input(char *prompt, char command[BUFSIZ])
+
+int cmdedit_read_input(char *prompt, char command[BUFSIZ])
{
int break_out = 0;
@@ -1231,10 +1232,15 @@ extern void cmdedit_read_input(char *prompt, char command[BUFSIZ])
* if the len=0 and no chars to delete */
if (len == 0) {
prepare_to_die:
+#if !defined(BB_FEATURE_ASH)
printf("exit");
goto_new_line();
/* cmdedit_reset_term() called in atexit */
exit(EXIT_SUCCESS);
+#else
+ break_out = -1; /* for control stoped jobs */
+ break;
+#endif
} else {
input_delete();
}
@@ -1455,8 +1461,10 @@ prepare_to_die:
num_ok_lines++;
#endif
}
+ if(break_out>0) {
command[len++] = '\n'; /* set '\n' */
command[len] = 0;
+ }
#if defined(BB_FEATURE_CLEAN_UP) && defined(BB_FEATURE_COMMAND_TAB_COMPLETION)
input_tab(0); /* strong free */
#endif
@@ -1464,6 +1472,7 @@ prepare_to_die:
free(cmdedit_prompt);
#endif
cmdedit_reset_term();
+ return len;
}