From 11aa191bdcce3aed778e44e13e8c3151722b5ff6 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Mon, 22 Apr 2019 19:45:42 +0200 Subject: [PATCH] tweaks: rename a variable, to distinguish it from a browser function --- src/files.c | 2 +- src/global.c | 4 +++- src/nano.c | 4 ++-- src/proto.h | 4 +++- src/winio.c | 4 ++-- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/files.c b/src/files.c index cb3a551f..219620b9 100644 --- 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 index 281c0f77..5e3ce249 100644 --- 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 index 49444c14..ae1d5302 100644 --- 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 index 5fb1ca74..72b33393 100644 --- 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 index 9a9d973b..435a48f8 100644 --- 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