ash,hush: optional support for $HISTFILESIZE.
Based on patch from Alexey Fomenko (ext-alexey.fomenko AT nokia.com) function old new delta size_from_HISTFILESIZE - 44 +44 hush_main 998 1025 +27 ash_main 1348 1374 +26 read_line_input 3361 3372 +11 new_line_input_t 17 24 +7 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
@ -13143,10 +13143,9 @@ int ash_main(int argc UNUSED_PARAM, char **argv)
|
||||
#if ENABLE_FEATURE_EDITING_SAVEHISTORY
|
||||
if (iflag) {
|
||||
const char *hp = lookupvar("HISTFILE");
|
||||
|
||||
if (hp == NULL) {
|
||||
if (!hp) {
|
||||
hp = lookupvar("HOME");
|
||||
if (hp != NULL) {
|
||||
if (hp) {
|
||||
char *defhp = concat_path_file(hp, ".ash_history");
|
||||
setvar("HISTFILE", defhp, 0);
|
||||
free(defhp);
|
||||
@ -13195,6 +13194,10 @@ int ash_main(int argc UNUSED_PARAM, char **argv)
|
||||
const char *hp = lookupvar("HISTFILE");
|
||||
if (hp)
|
||||
line_input_state->hist_file = hp;
|
||||
# if ENABLE_FEATURE_SH_HISTFILESIZE
|
||||
hp = lookupvar("HISTFILESIZE");
|
||||
line_input_state->max_history = size_from_HISTFILESIZE(hp);
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
state4: /* XXX ??? - why isn't this before the "if" statement */
|
||||
|
Reference in New Issue
Block a user