diff options
author | Eric Andersen <andersen@codepoet.org> | 2001-07-17 01:12:36 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2001-07-17 01:12:36 +0000 |
commit | 044228d5ecb9b79397f9fc915d046cf4538281e2 (patch) | |
tree | 4c43e4947b0196d807249f8f6e1c9c679b6bbcde /shell/cmdedit.c | |
parent | 51ded05b3bf4df6f126420d39a40d27ea0728aa9 (diff) | |
download | busybox-w32-044228d5ecb9b79397f9fc915d046cf4538281e2.tar.gz busybox-w32-044228d5ecb9b79397f9fc915d046cf4538281e2.tar.bz2 busybox-w32-044228d5ecb9b79397f9fc915d046cf4538281e2.zip |
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.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/shell/cmdedit.c b/shell/cmdedit.c index 540eb7ea7..69f833747 100644 --- a/shell/cmdedit.c +++ b/shell/cmdedit.c | |||
@@ -1153,7 +1153,8 @@ enum { | |||
1153 | * | 1153 | * |
1154 | */ | 1154 | */ |
1155 | 1155 | ||
1156 | extern void cmdedit_read_input(char *prompt, char command[BUFSIZ]) | 1156 | |
1157 | int cmdedit_read_input(char *prompt, char command[BUFSIZ]) | ||
1157 | { | 1158 | { |
1158 | 1159 | ||
1159 | int break_out = 0; | 1160 | int break_out = 0; |
@@ -1231,10 +1232,15 @@ extern void cmdedit_read_input(char *prompt, char command[BUFSIZ]) | |||
1231 | * if the len=0 and no chars to delete */ | 1232 | * if the len=0 and no chars to delete */ |
1232 | if (len == 0) { | 1233 | if (len == 0) { |
1233 | prepare_to_die: | 1234 | prepare_to_die: |
1235 | #if !defined(BB_FEATURE_ASH) | ||
1234 | printf("exit"); | 1236 | printf("exit"); |
1235 | goto_new_line(); | 1237 | goto_new_line(); |
1236 | /* cmdedit_reset_term() called in atexit */ | 1238 | /* cmdedit_reset_term() called in atexit */ |
1237 | exit(EXIT_SUCCESS); | 1239 | exit(EXIT_SUCCESS); |
1240 | #else | ||
1241 | break_out = -1; /* for control stoped jobs */ | ||
1242 | break; | ||
1243 | #endif | ||
1238 | } else { | 1244 | } else { |
1239 | input_delete(); | 1245 | input_delete(); |
1240 | } | 1246 | } |
@@ -1455,8 +1461,10 @@ prepare_to_die: | |||
1455 | num_ok_lines++; | 1461 | num_ok_lines++; |
1456 | #endif | 1462 | #endif |
1457 | } | 1463 | } |
1464 | if(break_out>0) { | ||
1458 | command[len++] = '\n'; /* set '\n' */ | 1465 | command[len++] = '\n'; /* set '\n' */ |
1459 | command[len] = 0; | 1466 | command[len] = 0; |
1467 | } | ||
1460 | #if defined(BB_FEATURE_CLEAN_UP) && defined(BB_FEATURE_COMMAND_TAB_COMPLETION) | 1468 | #if defined(BB_FEATURE_CLEAN_UP) && defined(BB_FEATURE_COMMAND_TAB_COMPLETION) |
1461 | input_tab(0); /* strong free */ | 1469 | input_tab(0); /* strong free */ |
1462 | #endif | 1470 | #endif |
@@ -1464,6 +1472,7 @@ prepare_to_die: | |||
1464 | free(cmdedit_prompt); | 1472 | free(cmdedit_prompt); |
1465 | #endif | 1473 | #endif |
1466 | cmdedit_reset_term(); | 1474 | cmdedit_reset_term(); |
1475 | return len; | ||
1467 | } | 1476 | } |
1468 | 1477 | ||
1469 | 1478 | ||