nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit c8ab81dd1ca3eab25be429346ae52445d1b289cc
parent 185e4d6b1227b1d2c81ca459bc8a47492cf00819
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Wed, 13 Oct 2021 16:38:23 +0200

tweaks: rename two variables, to fit with the names of similar ones

Diffstat:
Msrc/history.c | 19++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/src/history.c b/src/history.c @@ -364,7 +364,8 @@ void load_poshistory(void) ssize_t read, count = 0; struct stat fileinfo; - poshiststruct *record_ptr = NULL, *newrecord; + poshiststruct *lastitem = NULL; + poshiststruct *newitem; char *lineptr, *columnptr; char *stanza = NULL; size_t dummy = 0; @@ -387,19 +388,19 @@ void load_poshistory(void) *(lineptr++) = '\0'; /* Create a new position record. */ - newrecord = nmalloc(sizeof(poshiststruct)); - newrecord->filename = copy_of(stanza); - newrecord->linenumber = atoi(lineptr); - newrecord->columnnumber = atoi(columnptr); - newrecord->next = NULL; + newitem = nmalloc(sizeof(poshiststruct)); + newitem->filename = copy_of(stanza); + newitem->linenumber = atoi(lineptr); + newitem->columnnumber = atoi(columnptr); + newitem->next = NULL; /* Add the record to the list. */ if (position_history == NULL) - position_history = newrecord; + position_history = newitem; else - record_ptr->next = newrecord; + lastitem->next = newitem; - record_ptr = newrecord; + lastitem = newitem; /* Impose a limit, so the file will not grow indefinitely. */ if (++count > 200) {