cscope/cscope-1-modified-from-patch-81-Fix-reading-include-files-in-.patch
DistroBaker c6481fdb9b Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/cscope.git#fd733a02b1b74cd0c9a34cb46fdaf37833f159a5
2021-03-22 09:35:32 +00:00

46 lines
1.7 KiB
Diff

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