diff options
author | bug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2004-02-22 11:13:28 +0000 |
---|---|---|
committer | bug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2004-02-22 11:13:28 +0000 |
commit | 2f88a40efa2e8e164b039a823b72e7d39117588d (patch) | |
tree | 10cbb5dc5a5f461a728c053d3a72dcbd158bb571 /shell | |
parent | 70d2f1eaf8ccae2cd81b349e735c2a59d35af365 (diff) | |
download | busybox-w32-2f88a40efa2e8e164b039a823b72e7d39117588d.tar.gz busybox-w32-2f88a40efa2e8e164b039a823b72e7d39117588d.tar.bz2 busybox-w32-2f88a40efa2e8e164b039a823b72e7d39117588d.zip |
Vodz. last_patch_128
- declare applet_using as static from applets.c
- small correction to cmdedit,
previous version cleared history after Ctrl-C
- small spelling correction (by Friedrich Lobenstock)
git-svn-id: svn://busybox.net/trunk/busybox@8544 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'shell')
-rw-r--r-- | shell/cmdedit.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/shell/cmdedit.c b/shell/cmdedit.c index c0fa1b255..bf945f7e7 100644 --- a/shell/cmdedit.c +++ b/shell/cmdedit.c | |||
@@ -1290,7 +1290,7 @@ int cmdedit_read_input(char *prompt, char command[BUFSIZ]) | |||
1290 | put_prompt(); | 1290 | put_prompt(); |
1291 | #else | 1291 | #else |
1292 | len = 0; | 1292 | len = 0; |
1293 | break_out = -1; /* for control traps */ | 1293 | break_out = -1; /* to control traps */ |
1294 | #endif | 1294 | #endif |
1295 | break; | 1295 | break; |
1296 | case 4: | 1296 | case 4: |
@@ -1304,7 +1304,8 @@ prepare_to_die: | |||
1304 | /* cmdedit_reset_term() called in atexit */ | 1304 | /* cmdedit_reset_term() called in atexit */ |
1305 | exit(EXIT_SUCCESS); | 1305 | exit(EXIT_SUCCESS); |
1306 | #else | 1306 | #else |
1307 | len = break_out = -1; /* for control stoped jobs */ | 1307 | /* to control stopped jobs */ |
1308 | len = break_out = -1; | ||
1308 | break; | 1309 | break; |
1309 | #endif | 1310 | #endif |
1310 | } else { | 1311 | } else { |
@@ -1430,12 +1431,12 @@ rewrite_line: | |||
1430 | break; | 1431 | break; |
1431 | case '1': | 1432 | case '1': |
1432 | case 'H': | 1433 | case 'H': |
1433 | /* Home (Ctrl-A) */ | 1434 | /* <Home> */ |
1434 | input_backward(cursor); | 1435 | input_backward(cursor); |
1435 | break; | 1436 | break; |
1436 | case '4': | 1437 | case '4': |
1437 | case 'F': | 1438 | case 'F': |
1438 | /* End (Ctrl-E) */ | 1439 | /* <End> */ |
1439 | input_end(); | 1440 | input_end(); |
1440 | break; | 1441 | break; |
1441 | default: | 1442 | default: |
@@ -1496,10 +1497,11 @@ rewrite_line: | |||
1496 | #if MAX_HISTORY >= 1 | 1497 | #if MAX_HISTORY >= 1 |
1497 | /* Handle command history log */ | 1498 | /* Handle command history log */ |
1498 | /* cleanup may be saved current command line */ | 1499 | /* cleanup may be saved current command line */ |
1499 | free(history[MAX_HISTORY]); | ||
1500 | history[MAX_HISTORY] = 0; | ||
1501 | if (len> 0) { /* no put empty line */ | 1500 | if (len> 0) { /* no put empty line */ |
1502 | int i = n_history; | 1501 | int i = n_history; |
1502 | |||
1503 | free(history[MAX_HISTORY]); | ||
1504 | history[MAX_HISTORY] = 0; | ||
1503 | /* After max history, remove the oldest command */ | 1505 | /* After max history, remove the oldest command */ |
1504 | if (i >= MAX_HISTORY) { | 1506 | if (i >= MAX_HISTORY) { |
1505 | free(history[0]); | 1507 | free(history[0]); |