mirror of
https://github.com/sheumann/hush.git
synced 2024-12-22 14:30:31 +00:00
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)
This commit is contained in:
parent
90ed9a0eb6
commit
7fc504c6f7
@ -37,7 +37,7 @@
|
|||||||
#undef PROTOTYPES
|
#undef PROTOTYPES
|
||||||
#include "applets.h"
|
#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. */
|
/* The -1 arises because of the {0,NULL,0,-1} entry above. */
|
||||||
const size_t NUM_APPLETS = (sizeof (applets) / sizeof (struct BB_applet) - 1);
|
const size_t NUM_APPLETS = (sizeof (applets) / sizeof (struct BB_applet) - 1);
|
||||||
|
@ -1290,7 +1290,7 @@ int cmdedit_read_input(char *prompt, char command[BUFSIZ])
|
|||||||
put_prompt();
|
put_prompt();
|
||||||
#else
|
#else
|
||||||
len = 0;
|
len = 0;
|
||||||
break_out = -1; /* for control traps */
|
break_out = -1; /* to control traps */
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
@ -1304,7 +1304,8 @@ prepare_to_die:
|
|||||||
/* cmdedit_reset_term() called in atexit */
|
/* cmdedit_reset_term() called in atexit */
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
#else
|
#else
|
||||||
len = break_out = -1; /* for control stoped jobs */
|
/* to control stopped jobs */
|
||||||
|
len = break_out = -1;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
@ -1430,12 +1431,12 @@ rewrite_line:
|
|||||||
break;
|
break;
|
||||||
case '1':
|
case '1':
|
||||||
case 'H':
|
case 'H':
|
||||||
/* Home (Ctrl-A) */
|
/* <Home> */
|
||||||
input_backward(cursor);
|
input_backward(cursor);
|
||||||
break;
|
break;
|
||||||
case '4':
|
case '4':
|
||||||
case 'F':
|
case 'F':
|
||||||
/* End (Ctrl-E) */
|
/* <End> */
|
||||||
input_end();
|
input_end();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -1496,10 +1497,11 @@ rewrite_line:
|
|||||||
#if MAX_HISTORY >= 1
|
#if MAX_HISTORY >= 1
|
||||||
/* Handle command history log */
|
/* Handle command history log */
|
||||||
/* cleanup may be saved current command line */
|
/* cleanup may be saved current command line */
|
||||||
free(history[MAX_HISTORY]);
|
|
||||||
history[MAX_HISTORY] = 0;
|
|
||||||
if (len> 0) { /* no put empty line */
|
if (len> 0) { /* no put empty line */
|
||||||
int i = n_history;
|
int i = n_history;
|
||||||
|
|
||||||
|
free(history[MAX_HISTORY]);
|
||||||
|
history[MAX_HISTORY] = 0;
|
||||||
/* After max history, remove the oldest command */
|
/* After max history, remove the oldest command */
|
||||||
if (i >= MAX_HISTORY) {
|
if (i >= MAX_HISTORY) {
|
||||||
free(history[0]);
|
free(history[0]);
|
||||||
|
Loading…
Reference in New Issue
Block a user