commit 11aa191bdcce3aed778e44e13e8c3151722b5ff6
parent ea844d28fe101d028ea1e5970729dcd595e02c32
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Mon, 22 Apr 2019 19:45:42 +0200
tweaks: rename a variable, to distinguish it from a browser function
Diffstat:
5 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/src/files.c b/src/files.c
@@ -70,7 +70,7 @@ void make_new_buffer(void)
newnode->prev = newnode;
newnode->next = newnode;
- firstfile = newnode;
+ startfile = newnode;
} else {
/* Add the new open file after the current one in the list. */
newnode->prev = openfile;
diff --git a/src/global.c b/src/global.c
@@ -127,8 +127,10 @@ partition *filepart = NULL;
/* The "partition" where we store a portion of the current file. */
openfilestruct *openfile = NULL;
/* The list of all open file buffers. */
-openfilestruct *firstfile = NULL;
+#ifdef ENABLE_MULTIBUFFER
+openfilestruct *startfile = NULL;
/* The first open buffer. */
+#endif
#ifndef NANO_TINY
char *matchbrackets = NULL;
diff --git a/src/nano.c b/src/nano.c
@@ -493,8 +493,8 @@ void copy_from_buffer(linestruct *somebuffer)
/* Unlink a node from the rest of the circular list, and delete it. */
void unlink_opennode(openfilestruct *fileptr)
{
- if (fileptr == firstfile)
- firstfile = firstfile->next;
+ if (fileptr == startfile)
+ startfile = startfile->next;
fileptr->prev->next = fileptr->next;
fileptr->next->prev = fileptr->prev;
diff --git a/src/proto.h b/src/proto.h
@@ -98,7 +98,9 @@ extern bool keep_cutbuffer;
extern partition *filepart;
extern openfilestruct *openfile;
-extern openfilestruct *firstfile;
+#ifdef ENABLE_MULTIBUFFER
+extern openfilestruct *startfile;
+#endif
#ifndef NANO_TINY
extern char *matchbrackets;
diff --git a/src/winio.c b/src/winio.c
@@ -2023,7 +2023,7 @@ int buffer_number(openfilestruct *buffer)
{
int count = 1;
- while (buffer != firstfile) {
+ while (buffer != startfile) {
buffer = buffer->prev;
count++;
}
@@ -2088,7 +2088,7 @@ void titlebar(const char *path)
if (more_than_one) {
indicator = charalloc(24);
sprintf(indicator, "[%i/%i]", buffer_number(openfile),
- buffer_number(firstfile->prev));
+ buffer_number(startfile->prev));
upperleft = indicator;
} else
#endif