From 5726514869fbac0a9cd6bb13348c295c5763844c Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@telfort.nl>
Date: Sun, 25 Mar 2018 21:41:46 +0200
Subject: [PATCH] linting: drop messages for other files when configured for
 one buffer

This fixes https://savannah.gnu.org/bugs/?53445.
---
 src/text.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/text.c b/src/text.c
index 43e2acdd..a454a9a6 100644
--- a/src/text.c
+++ b/src/text.c
@@ -3198,19 +3198,21 @@ void do_linter(void)
 	while (TRUE) {
 		int kbinput;
 		functionptrtype func;
-#ifdef ENABLE_MULTIBUFFER
 		struct stat lintfileinfo;
 
 		if (stat(curlint->filename, &lintfileinfo) != -1 &&
 			openfile->current_stat->st_ino != lintfileinfo.st_ino) {
 			openfilestruct *tmpof = openfile;
 
+#ifdef ENABLE_MULTIBUFFER
 			while (tmpof != openfile->next) {
 				if (tmpof->current_stat->st_ino == lintfileinfo.st_ino)
 					break;
 				tmpof = tmpof->next;
 			}
+#endif
 			if (tmpof->current_stat->st_ino != lintfileinfo.st_ino) {
+#ifdef ENABLE_MULTIBUFFER
 				char *msg = charalloc(1024 + strlen(curlint->filename));
 				int i;
 
@@ -3225,6 +3227,7 @@ void do_linter(void)
 				} else if (i == 1) {
 					open_buffer(curlint->filename, TRUE);
 				} else {
+#endif
 					char *dontwantfile = mallocstrcpy(NULL, curlint->filename);
 					lintstruct *restlint = NULL;
 
@@ -3259,10 +3262,11 @@ void do_linter(void)
 
 					free(dontwantfile);
 				}
+#ifdef ENABLE_MULTIBUFFER
 			} else
 				openfile = tmpof;
+#endif
 		}
-#endif /* ENABLE_MULTIBUFFER */
 
 		if (tmplint != curlint) {
 			goto_line_posx(curlint->lineno, curlint->colno - 1);
-- 
GitLab