Differentiating a variable name from function names.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5551 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
Benno Schulenberg 2016-01-12 19:20:40 +00:00
parent cb832bef1b
commit deb271d708
4 changed files with 12 additions and 10 deletions

View File

@ -2,6 +2,8 @@
* NEWS: Fix some typos and whitespace, and normalize the dates.
* src/files.c (load_poshistory): Rename a variable.
* src/files.c (load_poshistory): Remove some code duplication.
* src/files.c (save_poshistory, update_poshistory, check_poshistory,
load_poshistory): Differentiate variable name from function names.
GNU nano 2.5.1 - 2016.01.11

View File

@ -3124,7 +3124,7 @@ void save_poshistory(void)
* history file. */
chmod(poshist, S_IRUSR | S_IWUSR);
for (posptr = poshistory; posptr != NULL; posptr = posptr->next) {
for (posptr = position_history; posptr != NULL; posptr = posptr->next) {
statusstr = charalloc(strlen(posptr->filename) + 2 * sizeof(ssize_t) + 4);
sprintf(statusstr, "%s %ld %ld\n", posptr->filename, (long)posptr->lineno,
(long)posptr->xno);
@ -3149,7 +3149,7 @@ void update_poshistory(char *filename, ssize_t lineno, ssize_t xpos)
if (fullpath == NULL)
return;
for (posptr = poshistory; posptr != NULL; posptr = posptr->next) {
for (posptr = position_history; posptr != NULL; posptr = posptr->next) {
if (!strcmp(posptr->filename, fullpath)) {
posptr->lineno = lineno;
posptr->xno = xpos;
@ -3166,8 +3166,8 @@ void update_poshistory(char *filename, ssize_t lineno, ssize_t xpos)
posptr->xno = xpos;
posptr->next = NULL;
if (!poshistory)
poshistory = posptr;
if (position_history == NULL)
position_history = posptr;
else
posprev->next = posptr;
@ -3185,7 +3185,7 @@ int check_poshistory(const char *file, ssize_t *line, ssize_t *column)
if (fullpath == NULL)
return 0;
for (posptr = poshistory; posptr != NULL; posptr = posptr->next) {
for (posptr = position_history; posptr != NULL; posptr = posptr->next) {
if (!strcmp(posptr->filename, fullpath)) {
*line = posptr->lineno;
*column = posptr->xno;
@ -3238,10 +3238,10 @@ void load_poshistory(void)
newrecord->next = NULL;
/* Add the record to the list. */
if (poshistory == NULL)
poshistory = newrecord;
if (position_history == NULL)
position_history = newrecord;
else {
for (posptr = poshistory; posptr->next != NULL;)
for (posptr = position_history; posptr->next != NULL;)
posptr = posptr->next;
posptr->next = newrecord;
}

View File

@ -190,7 +190,7 @@ filestruct *replaceage = NULL;
/* The top of the replace string history list. */
filestruct *replacebot = NULL;
/* The bottom of the replace string history list. */
poshiststruct *poshistory;
poshiststruct *position_history = NULL;
/* The cursor position history list. */
#endif

View File

@ -128,7 +128,7 @@ extern filestruct *searchbot;
extern filestruct *replace_history;
extern filestruct *replaceage;
extern filestruct *replacebot;
extern poshiststruct *poshistory;
extern poshiststruct *position_history;
#endif
#ifdef HAVE_REGEX_H