bc: do not allocate line editing state until needed
function old new delta xc_read_line 324 353 +29 free_line_input_t 34 39 +5 xc_vm_init 656 640 -16 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/1 up/down: 34/-16) Total: 18 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
@ -14177,8 +14177,7 @@ exitshell(void)
|
||||
char *p;
|
||||
|
||||
#if ENABLE_FEATURE_EDITING_SAVE_ON_EXIT
|
||||
if (line_input_state)
|
||||
save_history(line_input_state);
|
||||
save_history(line_input_state); /* may be NULL */
|
||||
#endif
|
||||
savestatus = exitstatus;
|
||||
TRACE(("pid %d, exitshell(%d)\n", getpid(), savestatus));
|
||||
|
@ -2056,8 +2056,7 @@ static sighandler_t pick_sighandler(unsigned sig)
|
||||
static void hush_exit(int exitcode)
|
||||
{
|
||||
#if ENABLE_FEATURE_EDITING_SAVE_ON_EXIT
|
||||
if (G.line_input_state)
|
||||
save_history(G.line_input_state);
|
||||
save_history(G.line_input_state); /* may be NULL */
|
||||
#endif
|
||||
|
||||
fflush_all();
|
||||
|
Reference in New Issue
Block a user