commit deb271d7085dbb9b0245fa6f70968661dd5019f7
parent cb832bef1b3f363cad8c8924bd559f0292aa854c
Author: Benno Schulenberg <bensberg@justemail.net>
Date: Tue, 12 Jan 2016 19:20:40 +0000
Differentiating a variable name from function names.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5551 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Diffstat:
4 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -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
diff --git a/src/files.c b/src/files.c
@@ -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;
}
diff --git a/src/global.c b/src/global.c
@@ -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
diff --git a/src/proto.h b/src/proto.h
@@ -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