diff options
author | Glenn L McGrath <bug1@ihug.co.nz> | 2004-02-04 08:24:39 +0000 |
---|---|---|
committer | Glenn L McGrath <bug1@ihug.co.nz> | 2004-02-04 08:24:39 +0000 |
commit | 16e45d7e29a35c57fc31484e72f1294144e4899c (patch) | |
tree | ece28ef81d8de5930894aa3e9b61f8a64022ec7a /shell/cmdedit.c | |
parent | 31b98dd09748535a5004e948bb560c320d179a66 (diff) | |
download | busybox-w32-16e45d7e29a35c57fc31484e72f1294144e4899c.tar.gz busybox-w32-16e45d7e29a35c57fc31484e72f1294144e4899c.tar.bz2 busybox-w32-16e45d7e29a35c57fc31484e72f1294144e4899c.zip |
Vodz last_patch_125_2, this patch have:
- synced with dash 0.4.21
- better handle trap "cmds..." SIGINT (strange, i make bad hack for ash
and cmdedit, but this work only with this...)
- may be haven`t problem with Ctrl-D
Diffstat (limited to 'shell/cmdedit.c')
-rw-r--r-- | shell/cmdedit.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/shell/cmdedit.c b/shell/cmdedit.c index f54d5d587..c0fa1b255 100644 --- a/shell/cmdedit.c +++ b/shell/cmdedit.c | |||
@@ -1283,10 +1283,15 @@ int cmdedit_read_input(char *prompt, char command[BUFSIZ]) | |||
1283 | case 3: | 1283 | case 3: |
1284 | /* Control-c -- stop gathering input */ | 1284 | /* Control-c -- stop gathering input */ |
1285 | goto_new_line(); | 1285 | goto_new_line(); |
1286 | #ifndef CONFIG_ASH | ||
1286 | command[0] = 0; | 1287 | command[0] = 0; |
1287 | len = 0; | 1288 | len = 0; |
1288 | lastWasTab = FALSE; | 1289 | lastWasTab = FALSE; |
1289 | put_prompt(); | 1290 | put_prompt(); |
1291 | #else | ||
1292 | len = 0; | ||
1293 | break_out = -1; /* for control traps */ | ||
1294 | #endif | ||
1290 | break; | 1295 | break; |
1291 | case 4: | 1296 | case 4: |
1292 | /* Control-d -- Delete one character, or exit | 1297 | /* Control-d -- Delete one character, or exit |
@@ -1299,7 +1304,7 @@ prepare_to_die: | |||
1299 | /* cmdedit_reset_term() called in atexit */ | 1304 | /* cmdedit_reset_term() called in atexit */ |
1300 | exit(EXIT_SUCCESS); | 1305 | exit(EXIT_SUCCESS); |
1301 | #else | 1306 | #else |
1302 | break_out = -1; /* for control stoped jobs */ | 1307 | len = break_out = -1; /* for control stoped jobs */ |
1303 | break; | 1308 | break; |
1304 | #endif | 1309 | #endif |
1305 | } else { | 1310 | } else { |
@@ -1493,7 +1498,7 @@ rewrite_line: | |||
1493 | /* cleanup may be saved current command line */ | 1498 | /* cleanup may be saved current command line */ |
1494 | free(history[MAX_HISTORY]); | 1499 | free(history[MAX_HISTORY]); |
1495 | history[MAX_HISTORY] = 0; | 1500 | history[MAX_HISTORY] = 0; |
1496 | if (len) { /* no put empty line */ | 1501 | if (len> 0) { /* no put empty line */ |
1497 | int i = n_history; | 1502 | int i = n_history; |
1498 | /* After max history, remove the oldest command */ | 1503 | /* After max history, remove the oldest command */ |
1499 | if (i >= MAX_HISTORY) { | 1504 | if (i >= MAX_HISTORY) { |
@@ -1510,7 +1515,7 @@ rewrite_line: | |||
1510 | } | 1515 | } |
1511 | #else /* MAX_HISTORY < 1 */ | 1516 | #else /* MAX_HISTORY < 1 */ |
1512 | #if defined(CONFIG_FEATURE_SH_FANCY_PROMPT) | 1517 | #if defined(CONFIG_FEATURE_SH_FANCY_PROMPT) |
1513 | if (len) { /* no put empty line */ | 1518 | if (len > 0) { /* no put empty line */ |
1514 | num_ok_lines++; | 1519 | num_ok_lines++; |
1515 | } | 1520 | } |
1516 | #endif | 1521 | #endif |