From 7fc504c6f7ecd1c64387470c38af6f903c013218 Mon Sep 17 00:00:00 2001 From: Glenn L McGrath Date: Sun, 22 Feb 2004 11:13:28 +0000 Subject: 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) --- applets/applets.c | 2 +- shell/cmdedit.c | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/applets/applets.c b/applets/applets.c index 8bb36dd6a..9dc69f36f 100644 --- a/applets/applets.c +++ b/applets/applets.c @@ -37,7 +37,7 @@ #undef PROTOTYPES #include "applets.h" -struct BB_applet *applet_using; +static struct BB_applet *applet_using; /* The -1 arises because of the {0,NULL,0,-1} entry above. */ const size_t NUM_APPLETS = (sizeof (applets) / sizeof (struct BB_applet) - 1); 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]) put_prompt(); #else len = 0; - break_out = -1; /* for control traps */ + break_out = -1; /* to control traps */ #endif break; case 4: @@ -1304,7 +1304,8 @@ prepare_to_die: /* cmdedit_reset_term() called in atexit */ exit(EXIT_SUCCESS); #else - len = break_out = -1; /* for control stoped jobs */ + /* to control stopped jobs */ + len = break_out = -1; break; #endif } else { @@ -1430,12 +1431,12 @@ rewrite_line: break; case '1': case 'H': - /* Home (Ctrl-A) */ + /* */ input_backward(cursor); break; case '4': case 'F': - /* End (Ctrl-E) */ + /* */ input_end(); break; default: @@ -1496,10 +1497,11 @@ rewrite_line: #if MAX_HISTORY >= 1 /* Handle command history log */ /* cleanup may be saved current command line */ - free(history[MAX_HISTORY]); - history[MAX_HISTORY] = 0; if (len> 0) { /* no put empty line */ int i = n_history; + + free(history[MAX_HISTORY]); + history[MAX_HISTORY] = 0; /* After max history, remove the oldest command */ if (i >= MAX_HISTORY) { free(history[0]); -- cgit v1.2.3