commit 36e88032cb350437cdc9cc6a84ee60331edf2b0f
parent e0a73f58f35c5854ad319f4cc8b2410319f5b664
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Sun, 17 Sep 2017 16:54:45 +0200
tweaks: rename two variables, to make a little more sense
Diffstat:
3 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/src/global.c b/src/global.c
@@ -206,13 +206,13 @@ subnfunc *uncutfunc;
#ifndef DISABLE_HISTORIES
filestruct *search_history = NULL;
/* The search string history list. */
-filestruct *searchage = NULL;
+filestruct *searchtop = NULL;
/* The top of the search string history list. */
filestruct *searchbot = NULL;
/* The bottom of the search string history list. */
filestruct *replace_history = NULL;
/* The replace string history list. */
-filestruct *replaceage = NULL;
+filestruct *replacetop = NULL;
/* The top of the replace string history list. */
filestruct *replacebot = NULL;
/* The bottom of the replace string history list. */
@@ -1832,8 +1832,8 @@ void thanks_for_all_the_fish(void)
#endif /* !DISABLE_COLOR */
#ifndef DISABLE_HISTORIES
/* Free the search and replace history lists. */
- free_filestruct(searchage);
- free_filestruct(replaceage);
+ free_filestruct(searchtop);
+ free_filestruct(replacetop);
#endif
/* Free the list of functions. */
while (allfuncs != NULL) {
diff --git a/src/history.c b/src/history.c
@@ -33,12 +33,12 @@ void history_init(void)
{
search_history = make_new_node(NULL);
search_history->data = mallocstrcpy(NULL, "");
- searchage = search_history;
+ searchtop = search_history;
searchbot = search_history;
replace_history = make_new_node(NULL);
replace_history->data = mallocstrcpy(NULL, "");
- replaceage = replace_history;
+ replacetop = replace_history;
replacebot = replace_history;
execute_history = make_new_node(NULL);
@@ -81,10 +81,10 @@ void update_history(filestruct **h, const char *s)
filestruct **hage = NULL, **hbot = NULL, *thesame;
if (*h == search_history) {
- hage = &searchage;
+ hage = &searchtop;
hbot = &searchbot;
} else if (*h == replace_history) {
- hage = &replaceage;
+ hage = &replacetop;
hbot = &replacebot;
} else if (*h == execute_history) {
hage = &executetop;
@@ -174,10 +174,10 @@ char *get_history_completion(filestruct **h, char *s, size_t len)
filestruct *hage = NULL, *hbot = NULL, *p;
if (*h == search_history) {
- hage = searchage;
+ hage = searchtop;
hbot = searchbot;
} else if (*h == replace_history) {
- hage = replaceage;
+ hage = replacetop;
hbot = replacebot;
} else if (*h == execute_history) {
hage = executetop;
@@ -405,7 +405,7 @@ void save_history(void)
/* Don't allow others to read or write the history file. */
chmod(searchhist, S_IRUSR | S_IWUSR);
- if (!writehist(hist, searchage) || !writehist(hist, replaceage) ||
+ if (!writehist(hist, searchtop) || !writehist(hist, replacetop) ||
!writehist(hist, executetop))
fprintf(stderr, _("Error writing %s: %s\n"), searchhist,
strerror(errno));
diff --git a/src/proto.h b/src/proto.h
@@ -160,10 +160,10 @@ extern subnfunc *uncutfunc;
#ifndef DISABLE_HISTORIES
extern filestruct *search_history;
-extern filestruct *searchage;
+extern filestruct *searchtop;
extern filestruct *searchbot;
extern filestruct *replace_history;
-extern filestruct *replaceage;
+extern filestruct *replacetop;
extern filestruct *replacebot;
extern filestruct *execute_history;
extern filestruct *executetop;