Blame SOURCES/cscope-1-modified-from-patch-81-Fix-reading-include-files-in-.patch

565b65
From 39fb385d69dc06343e8f8a7e28d516d5aef97ec8 Mon Sep 17 00:00:00 2001
565b65
From: Hans-Bernhard Broeker <HBBroeker@T-Online.de>
565b65
Date: Sat, 28 Jul 2018 17:50:03 +0200
565b65
Subject: [PATCH 1/9] [modified from patch #81] Fix reading include files in -c
565b65
 mode
565b65
565b65
Signed-off-by: Vladis Dronov <vdronov@redhat.com>
565b65
---
565b65
 src/build.c | 6 +++---
565b65
 1 file changed, 3 insertions(+), 3 deletions(-)
565b65
565b65
diff --git a/src/build.c b/src/build.c
565b65
index a32b5cb..557e660 100644
565b65
--- a/src/build.c
565b65
+++ b/src/build.c
565b65
@@ -124,7 +124,7 @@ samelist(FILE *oldrefs, char **names, int count)
565b65
     }
565b65
     /* see if the name list is the same */
565b65
     for (i = 0; i < count; ++i) {
565b65
-	if ((1 != fscanf(oldrefs," %[^\n]",oldname)) ||
565b65
+	if ((1 != fscanf(oldrefs," %" PATHLEN_STR "[^\n]",oldname)) ||
565b65
 	    strnotequal(oldname, names[i])) {
565b65
 	    return(NO);
565b65
 	}
565b65
@@ -305,7 +305,7 @@ cscope: -q option mismatch between command line and old symbol database\n");
565b65
 	/* see if the list of source files is the same and
565b65
 	   none have been changed up to the included files */
565b65
 	for (i = 0; i < nsrcfiles; ++i) {
565b65
-	    if ((1 != fscanf(oldrefs," %[^\n]",oldname))
565b65
+	    if ((1 != fscanf(oldrefs, " %" PATHLEN_STR "[^\n]", oldname))
565b65
 		|| strnotequal(oldname, srcfiles[i])
565b65
 		|| (lstat(srcfiles[i], &statstruct) != 0)
565b65
 		|| (statstruct.st_mtime > reftime)
565b65
@@ -315,7 +315,7 @@ cscope: -q option mismatch between command line and old symbol database\n");
565b65
 	}
565b65
 	/* the old cross-reference is up-to-date */
565b65
 	/* so get the list of included files */
565b65
-	while (i++ < oldnum && fgets(oldname, sizeof(oldname), oldrefs)) {
565b65
+	while (i++ < oldnum && fscanf(oldrefs, "%" PATHLEN_STR "s", oldname)) {
565b65
 	    addsrcfile(oldname);
565b65
 	}
565b65
 	fclose(oldrefs);
565b65
-- 
565b65
2.26.2
565b65