diff --git a/src/history.c b/src/history.c index 985413df..9cf080e0 100644 --- a/src/history.c +++ b/src/history.c @@ -63,14 +63,14 @@ void history_init(void) executebot = execute_history; } -/* Set the current position in the given history list to the bottom. */ -void history_reset(const linestruct *list) +/* Reset the pointer into the history list that contains item to the bottom. */ +void reset_history_pointer_for(const linestruct *item) { - if (list == search_history) + if (item == search_history) search_history = searchbot; - else if (list == replace_history) + else if (item == replace_history) replace_history = replacebot; - else if (list == execute_history) + else if (item == execute_history) execute_history = executebot; } diff --git a/src/prompt.c b/src/prompt.c index 44a12fbe..37f8e81d 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -456,7 +456,7 @@ functionptrtype acquire_an_answer(int *actual, bool *listed, #endif if (history_list != NULL) - history_reset(*history_list); + reset_history_pointer_for(*history_list); #endif /* ENABLE_HISTORIES */ if (typing_x > strlen(answer)) @@ -568,7 +568,7 @@ functionptrtype acquire_an_answer(int *actual, bool *listed, #ifdef ENABLE_HISTORIES /* Put the history pointer back at the bottom of the list. */ if (history_list != NULL) { - history_reset(*history_list); + reset_history_pointer_for(*history_list); free(magichistory); } #endif diff --git a/src/prototypes.h b/src/prototypes.h index 5fd59b52..a6bd6400 100644 --- a/src/prototypes.h +++ b/src/prototypes.h @@ -334,7 +334,7 @@ void do_help(void); /* Most functions in history.c. */ #ifdef ENABLE_HISTORIES void history_init(void); -void history_reset(const linestruct *list); +void reset_history_pointer_for(const linestruct *list); void update_history(linestruct **item, const char *text); #ifdef ENABLE_TABCOMP char *get_history_completion(linestruct **h, char *s, size_t len);