* 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
* 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);
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;
posptr->xno = xpos;
posptr->next = NULL;
- if (!poshistory)
- poshistory = posptr;
+ if (position_history == NULL)
+ position_history = posptr;
else
posprev->next = posptr;
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;
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;
}
/* 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
extern filestruct *replace_history;
extern filestruct *replaceage;
extern filestruct *replacebot;
-extern poshiststruct *poshistory;
+extern poshiststruct *position_history;
#endif
#ifdef HAVE_REGEX_H