commit
b6a26a6aed
@ -0,0 +1 @@
|
|||||||
|
e89c6a3458164552d9301ccc213181f463e5210e SOURCES/cscope-15.9.tar.gz
|
@ -0,0 +1 @@
|
|||||||
|
SOURCES/cscope-15.9.tar.gz
|
@ -0,0 +1,45 @@
|
|||||||
|
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
|
||||||
|
|
@ -0,0 +1,26 @@
|
|||||||
|
From 6a6998ecd0392ea643c4c4b317af9af8270761aa Mon Sep 17 00:00:00 2001
|
||||||
|
From: Hans-Bernhard Broeker <HBBroeker@T-Online.de>
|
||||||
|
Date: Thu, 9 Aug 2018 16:25:31 +0200
|
||||||
|
Subject: [PATCH 3/9] Cull extraneous declaration
|
||||||
|
|
||||||
|
Signed-off-by: Vladis Dronov <vdronov@redhat.com>
|
||||||
|
---
|
||||||
|
src/global.h | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/global.h b/src/global.h
|
||||||
|
index dbc8a43..a6f1486 100644
|
||||||
|
--- a/src/global.h
|
||||||
|
+++ b/src/global.h
|
||||||
|
@@ -224,7 +224,7 @@ extern char dicode2[]; /* digraph second character code */
|
||||||
|
+ dicode2[(unsigned char)(inchar2)])
|
||||||
|
|
||||||
|
/* main.c global data */
|
||||||
|
-extern char *editor, *home, *shell, *lineflag; /* environment variables */
|
||||||
|
+extern char *editor, *shell, *lineflag; /* environment variables */
|
||||||
|
extern char *home; /* Home directory */
|
||||||
|
extern BOOL lineflagafterfile;
|
||||||
|
extern char *argv0; /* command name */
|
||||||
|
--
|
||||||
|
2.26.2
|
||||||
|
|
@ -0,0 +1,32 @@
|
|||||||
|
From f693474b85f8dc1d31570833c62d9210ed1ffcf2 Mon Sep 17 00:00:00 2001
|
||||||
|
From: mikhail nefedov <mnefedov@users.sourceforge.net>
|
||||||
|
Date: Thu, 23 Aug 2018 00:36:52 +0200
|
||||||
|
Subject: [PATCH 4/9] Avoid putting directories found during header search into
|
||||||
|
srcfiles.
|
||||||
|
|
||||||
|
Signed-off-by: Vladis Dronov <vdronov@redhat.com>
|
||||||
|
---
|
||||||
|
src/dir.c | 7 +++++--
|
||||||
|
1 file changed, 5 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/dir.c b/src/dir.c
|
||||||
|
index 01c599e..7f7287e 100644
|
||||||
|
--- a/src/dir.c
|
||||||
|
+++ b/src/dir.c
|
||||||
|
@@ -616,8 +616,11 @@ incfile(char *file, char *type)
|
||||||
|
snprintf(path, sizeof(path), "%.*s/%s",
|
||||||
|
(int)(PATHLEN - 2 - file_len), incdirs[i],
|
||||||
|
file);
|
||||||
|
- if (access(compath(path), READ) == 0) {
|
||||||
|
- addsrcfile(path);
|
||||||
|
+ if (access(compath(path), READ) == 0) {
|
||||||
|
+ struct stat st;
|
||||||
|
+ if( 0 == stat(path,&st) && S_ISREG(st.st_mode) ) {
|
||||||
|
+ addsrcfile(path);
|
||||||
|
+ }
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.26.2
|
||||||
|
|
@ -0,0 +1,38 @@
|
|||||||
|
From f632c3fd86fce2c495a290dd70f5f09e3e7e7a28 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Hans-Bernhard Broeker <HBBroeker@T-Online.de>
|
||||||
|
Date: Sat, 13 Apr 2019 14:52:35 +0200
|
||||||
|
Subject: [PATCH 5/9] Avoid double-free via double fclose in changestring.
|
||||||
|
|
||||||
|
Mark closed FILE* by setting it to NULL, and check for that.
|
||||||
|
|
||||||
|
Signed-off-by: Vladis Dronov <vdronov@redhat.com>
|
||||||
|
---
|
||||||
|
src/command.c | 5 ++++-
|
||||||
|
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/command.c b/src/command.c
|
||||||
|
index 8740b11..dcb5278 100644
|
||||||
|
--- a/src/command.c
|
||||||
|
+++ b/src/command.c
|
||||||
|
@@ -786,6 +786,7 @@ changestring(void)
|
||||||
|
}
|
||||||
|
fprintf(script, "w\nq\n!\n"); /* write and quit */
|
||||||
|
fclose(script);
|
||||||
|
+ script = NULL;
|
||||||
|
|
||||||
|
/* if any line was marked */
|
||||||
|
if (anymarked == YES) {
|
||||||
|
@@ -803,7 +804,9 @@ changestring(void)
|
||||||
|
}
|
||||||
|
changing = NO;
|
||||||
|
mousemenu();
|
||||||
|
- fclose(script);
|
||||||
|
+ if (script != NULL) {
|
||||||
|
+ fclose(script);
|
||||||
|
+ }
|
||||||
|
free(change);
|
||||||
|
return(anymarked);
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.26.2
|
||||||
|
|
@ -0,0 +1,77 @@
|
|||||||
|
From bb7f25fad3cade493486a6287f5212cdfb6cce24 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Jari Aalto <jari.aalto@cante.net>
|
||||||
|
Date: Sat, 8 May 2010 20:15:35 +0300
|
||||||
|
Subject: [PATCH 6/9] contrib/ocs: Fix bashims (Closes: #480591)
|
||||||
|
|
||||||
|
Signed-off-by: Jari Aalto <jari.aalto@cante.net>
|
||||||
|
Signed-off-by: Vladis Dronov <vdronov@redhat.com>
|
||||||
|
---
|
||||||
|
contrib/ocs | 16 ++++++++--------
|
||||||
|
1 file changed, 8 insertions(+), 8 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/contrib/ocs b/contrib/ocs
|
||||||
|
index e924f4f..bd556b4 100755
|
||||||
|
--- a/contrib/ocs
|
||||||
|
+++ b/contrib/ocs
|
||||||
|
@@ -86,7 +86,7 @@ if [ ! -d ${SYSDIR} ]; then
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check that cscope is in PATH
|
||||||
|
-type cscope 1>/dev/null 2>&1
|
||||||
|
+which cscope 1>/dev/null 2>&1
|
||||||
|
|
||||||
|
if [ $? -ne 0 ]
|
||||||
|
then
|
||||||
|
@@ -167,8 +167,8 @@ create_list()
|
||||||
|
|
||||||
|
if [ "${FORCE}" != "Y" ]
|
||||||
|
then
|
||||||
|
- echo "\n${LIST}"
|
||||||
|
- echo "Update the library? <(Y)es, (N)o, (Q)uit> [n] \c"
|
||||||
|
+ printf "\n${LIST}\n"
|
||||||
|
+ printf "Update the library? <(Y)es, (N)o, (Q)uit> [n] "
|
||||||
|
read x y
|
||||||
|
case $x in
|
||||||
|
[Yy]* ) ;;
|
||||||
|
@@ -176,9 +176,9 @@ create_list()
|
||||||
|
*) return ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
- echo "Updating library:\n ${LIST} \c"
|
||||||
|
+ printf "Updating library:\n ${LIST} "
|
||||||
|
else
|
||||||
|
- echo "Creating library:\n ${LIST} \c"
|
||||||
|
+ printf "Creating library:\n ${LIST} "
|
||||||
|
fi
|
||||||
|
|
||||||
|
(
|
||||||
|
@@ -196,7 +196,7 @@ create_list()
|
||||||
|
-print
|
||||||
|
) | grep -v SCCS | sort -u > ${LIST}
|
||||||
|
|
||||||
|
- echo "\n`cat ${LIST} | wc -l` files listed"
|
||||||
|
+ printf "\n`cat ${LIST} | wc -l` files listed\n"
|
||||||
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
@@ -210,7 +210,7 @@ exp_inc()
|
||||||
|
then
|
||||||
|
for i in `cat ${theInc}`
|
||||||
|
do
|
||||||
|
- echo "-I $i \c"
|
||||||
|
+ printf "-I $i "
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
@@ -285,7 +285,7 @@ std_libs ${SYSDIR}$PWD
|
||||||
|
|
||||||
|
DIR=$PWD
|
||||||
|
if [ ! -n "${NOUPDATE}" -o -n "${SPECDEST}" ] ; then
|
||||||
|
-echo "Create new library? <(L)ocal, (H)ome, (S)ystem, (Q)uit> [q] \c"
|
||||||
|
+ printf "Create new library? <(L)ocal, (H)ome, (S)ystem, (Q)uit> [q] "
|
||||||
|
|
||||||
|
# shellcheck disable=SC2034
|
||||||
|
read x y
|
||||||
|
--
|
||||||
|
2.26.2
|
||||||
|
|
@ -0,0 +1,130 @@
|
|||||||
|
From 3f9e3da40a77274705c9cb9103a6046daa950f5d Mon Sep 17 00:00:00 2001
|
||||||
|
From: Jari Aalto <jari.aalto@cante.net>
|
||||||
|
Date: Sat, 8 May 2010 20:16:14 +0300
|
||||||
|
Subject: [PATCH 7/9] doc/cscope.1: Fix hyphens
|
||||||
|
|
||||||
|
Signed-off-by: Jari Aalto <jari.aalto@cante.net>
|
||||||
|
Signed-off-by: Vladis Dronov <vdronov@redhat.com>
|
||||||
|
---
|
||||||
|
doc/cscope.1 | 33 ++++++++++++++++-----------------
|
||||||
|
1 file changed, 16 insertions(+), 17 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/doc/cscope.1 b/doc/cscope.1
|
||||||
|
index ca94e8b..0318347 100644
|
||||||
|
--- a/doc/cscope.1
|
||||||
|
+++ b/doc/cscope.1
|
||||||
|
@@ -1,4 +1,3 @@
|
||||||
|
-.PU
|
||||||
|
.TH CSCOPE "1" "January 2007" "The Santa Cruz Operation"
|
||||||
|
.SH NAME
|
||||||
|
cscope - interactively examine a C program
|
||||||
|
@@ -106,7 +105,7 @@ below. (The #include files
|
||||||
|
may be specified with either double quotes or angle brackets.)
|
||||||
|
The incdir directory is searched in addition to the current
|
||||||
|
directory (which is searched first) and the standard list
|
||||||
|
-(which is searched last). If more than one occurrence of -I
|
||||||
|
+(which is searched last). If more than one occurrence of \-I
|
||||||
|
appears, the directories are searched in the order they appear
|
||||||
|
on the command line.
|
||||||
|
.TP
|
||||||
|
@@ -129,7 +128,7 @@ source trees generally do not use it.
|
||||||
|
.TP
|
||||||
|
.B -L
|
||||||
|
Do a single search with line-oriented output when used with the
|
||||||
|
--num pattern option.
|
||||||
|
+\-num pattern option.
|
||||||
|
.TP
|
||||||
|
.B -l
|
||||||
|
Line-oriented interface (see ``Line-Oriented Interface''
|
||||||
|
@@ -146,7 +145,7 @@ Prepend
|
||||||
|
.I path
|
||||||
|
to relative file names in a pre-built cross-reference file so you do
|
||||||
|
not have to change to the directory where the cross-reference file was
|
||||||
|
-built. This option is only valid with the -d option.
|
||||||
|
+built. This option is only valid with the \-d option.
|
||||||
|
.TP
|
||||||
|
.BI -p n
|
||||||
|
Display the last
|
||||||
|
@@ -195,7 +194,7 @@ Remove the cscope reference file and inverted indexes when exiting
|
||||||
|
.I files
|
||||||
|
A list of file names to operate on.
|
||||||
|
.PP
|
||||||
|
-The -I, -c, -k, -p, -q, and -T options can also be in the cscope.files file.
|
||||||
|
+The \-I, \-c, \-k, \-p, \-q, and \-T options can also be in the cscope.files file.
|
||||||
|
.PP
|
||||||
|
.SS Requesting the initial search
|
||||||
|
.PP
|
||||||
|
@@ -266,7 +265,7 @@ Append the displayed list of lines to a file.
|
||||||
|
.TP
|
||||||
|
.B <
|
||||||
|
Read lines from a file that is in symbol reference format
|
||||||
|
-(created by > or >>), just like the -F option.
|
||||||
|
+(created by > or >>), just like the \-F option.
|
||||||
|
.TP
|
||||||
|
.B ^
|
||||||
|
Filter all lines through a shell command and display the
|
||||||
|
@@ -371,7 +370,7 @@ commands, respectively.
|
||||||
|
.PP
|
||||||
|
.SS Line-Oriented interface
|
||||||
|
.PP
|
||||||
|
-The -l option lets you use cscope where a screen-oriented interface
|
||||||
|
+The \-l option lets you use cscope where a screen-oriented interface
|
||||||
|
would not be useful, for example, from another screen-oriented
|
||||||
|
program.
|
||||||
|
.PP
|
||||||
|
@@ -380,10 +379,10 @@ with the field number (counting from 0) immediately followed by the
|
||||||
|
search pattern, for example, ``lmain'' finds the definition of the
|
||||||
|
main function.
|
||||||
|
.PP
|
||||||
|
-If you just want a single search, instead of the -l option use the -L
|
||||||
|
-and -num pattern options, and you won't get the >> prompt.
|
||||||
|
+If you just want a single search, instead of the \-l option use the \-L
|
||||||
|
+and \-num pattern options, and you won't get the >> prompt.
|
||||||
|
.PP
|
||||||
|
-For -l, cscope outputs the number of reference lines
|
||||||
|
+For \-l, cscope outputs the number of reference lines
|
||||||
|
cscope: 2 lines
|
||||||
|
.PP
|
||||||
|
For each reference found, cscope outputs a line consisting of the file
|
||||||
|
@@ -468,11 +467,11 @@ is not set, cscope searches only in the current directory.
|
||||||
|
.SH FILES
|
||||||
|
.TP
|
||||||
|
.B cscope.files
|
||||||
|
-Default files containing -I, -p, -q, and -T options and the
|
||||||
|
-list of source files (overridden by the -i option).
|
||||||
|
+Default files containing \-I, \-p, \-q, and \-T options and the
|
||||||
|
+list of source files (overridden by the \-i option).
|
||||||
|
.TP
|
||||||
|
.B cscope.out
|
||||||
|
-Symbol cross-reference file (overridden by the -f option),
|
||||||
|
+Symbol cross-reference file (overridden by the \-f option),
|
||||||
|
which is put in the home directory if it cannot be created in
|
||||||
|
the current directory.
|
||||||
|
.TP
|
||||||
|
@@ -482,11 +481,11 @@ the current directory.
|
||||||
|
.B cscope.po.out
|
||||||
|
.PD 1
|
||||||
|
Default files containing the inverted index used for quick
|
||||||
|
-symbol searching (-q option). If you use the -f option to
|
||||||
|
+symbol searching (\-q option). If you use the \-f option to
|
||||||
|
rename the cross-reference file (so it's not cscope.out), the
|
||||||
|
names for these inverted index files will be created by adding
|
||||||
|
- .in and .po to the name you supply with -f. For example, if you
|
||||||
|
-indicated -f xyz, then these files would be named xyz.in and
|
||||||
|
+ .in and .po to the name you supply with \-f. For example, if you
|
||||||
|
+indicated \-f xyz, then these files would be named xyz.in and
|
||||||
|
xyz.po.
|
||||||
|
.TP
|
||||||
|
.B INCDIR
|
||||||
|
@@ -554,7 +553,7 @@ definition, for example,
|
||||||
|
.PP
|
||||||
|
char flag
|
||||||
|
#ifdef ALLOCATE_STORAGE
|
||||||
|
- = -1
|
||||||
|
+ = \-1
|
||||||
|
#endif
|
||||||
|
;
|
||||||
|
.PP
|
||||||
|
--
|
||||||
|
2.26.2
|
||||||
|
|
@ -0,0 +1,43 @@
|
|||||||
|
From e1b4cbc93529b07b3217928e8f9b1f43b80f9b06 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Jiri Slaby <jslaby@suse.cz>
|
||||||
|
Date: Fri, 5 Dec 2014 19:15:53 +0100
|
||||||
|
Subject: [PATCH 8/9] fscanner: swallow function as parameters
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Some functions take as a parameter a pointer to another function. This
|
||||||
|
causes troubles in the cscope scanner and such function definition is
|
||||||
|
dropped on the floor.
|
||||||
|
|
||||||
|
Instead of choking and skipping the definition/declaration, teach the
|
||||||
|
scanner about this case. So now cscope will not skip those and put
|
||||||
|
them properly in the index.
|
||||||
|
|
||||||
|
I carry this patch for a couple of months and using cscope daily on
|
||||||
|
the Linux kernel and see no problems.
|
||||||
|
|
||||||
|
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
|
||||||
|
Cc: Hans-Bernhard Bröker <broeker@users.sourceforge.net>
|
||||||
|
Cc: Neil Horman <nhorman@users.sourceforge.net>
|
||||||
|
Signed-off-by: Vladis Dronov <vdronov@redhat.com>
|
||||||
|
---
|
||||||
|
src/fscanner.l | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/fscanner.l b/src/fscanner.l
|
||||||
|
index 8a93192..43880bf 100644
|
||||||
|
--- a/src/fscanner.l
|
||||||
|
+++ b/src/fscanner.l
|
||||||
|
@@ -505,7 +505,7 @@ if{wsnl}*\( { /* ignore 'if' */
|
||||||
|
}
|
||||||
|
|
||||||
|
<WAS_IDENTIFIER>{
|
||||||
|
-{ws}*\(({wsnl}|{identifier}|{number}|[*&[\]=,.:])*\)([()]|{wsnl})*[:a-zA-Z_#{] {
|
||||||
|
+{ws}*\(({wsnl}|{identifier}|\({ws}*\*{ws}*{identifier}{ws}*\){ws}*\([^()]*\)|{number}|[*&[\]=,.:])*\)([()]|{wsnl})*[:a-zA-Z_#{] {
|
||||||
|
/* a function definition */
|
||||||
|
/* note: "#define a (b) {" and "#if defined(a)\n#"
|
||||||
|
* are not fcn definitions! */
|
||||||
|
--
|
||||||
|
2.26.2
|
||||||
|
|
@ -0,0 +1,75 @@
|
|||||||
|
From b3ab5461f1a02aa0a07a6f50bc2fa4da057193d1 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Dominique <dominique.pelle@gmail.com>
|
||||||
|
Date: Sun, 8 May 2022 08:27:32 +0200
|
||||||
|
Subject: [PATCH 1/2] fix: access beyond end of string when search called by
|
||||||
|
fails
|
||||||
|
Content-type: text/plain
|
||||||
|
|
||||||
|
findcalledby() returned a string which was not '\0' terminated.
|
||||||
|
That string is later output with the snprintf %s format which
|
||||||
|
accessed beyond the end of the string. Bug caused a crash on macOS
|
||||||
|
with M1 processor and was also causing a crash on Linux too when
|
||||||
|
building with asan (address sanitizer).
|
||||||
|
|
||||||
|
Signed-off-by: Vladis Dronov <vdronov@redhat.com>
|
||||||
|
---
|
||||||
|
src/find.c | 12 ++++++------
|
||||||
|
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/find.c b/src/find.c
|
||||||
|
index d7a66f0..e8f1141 100644
|
||||||
|
--- a/src/find.c
|
||||||
|
+++ b/src/find.c
|
||||||
|
@@ -1044,7 +1044,7 @@ char *
|
||||||
|
findcalledby(char *pattern)
|
||||||
|
{
|
||||||
|
char file[PATHLEN + 1]; /* source file name */
|
||||||
|
- static char found_caller = 'n'; /* seen calling function? */
|
||||||
|
+ static char found_caller[2] = "n"; /* seen calling function? */
|
||||||
|
BOOL macro = NO;
|
||||||
|
|
||||||
|
if (invertedindex == YES) {
|
||||||
|
@@ -1057,12 +1057,12 @@ findcalledby(char *pattern)
|
||||||
|
case FCNDEF:
|
||||||
|
if (dbseek(p->lineoffset) != -1 &&
|
||||||
|
scanpast('\t') != NULL) { /* skip def */
|
||||||
|
- found_caller = 'y';
|
||||||
|
+ found_caller[0] = 'y';
|
||||||
|
findcalledbysub(srcfiles[p->fileindex], macro);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
- return(&found_caller);
|
||||||
|
+ return(&found_caller[0]);
|
||||||
|
}
|
||||||
|
/* find the function definition(s) */
|
||||||
|
while (scanpast('\t') != NULL) {
|
||||||
|
@@ -1072,7 +1072,7 @@ findcalledby(char *pattern)
|
||||||
|
skiprefchar(); /* save file name */
|
||||||
|
fetch_string_from_dbase(file, sizeof(file));
|
||||||
|
if (*file == '\0') { /* if end of symbols */
|
||||||
|
- return(&found_caller);
|
||||||
|
+ return(&found_caller[0]);
|
||||||
|
}
|
||||||
|
progress("Search", searchcount, nsrcfiles);
|
||||||
|
break;
|
||||||
|
@@ -1087,14 +1087,14 @@ findcalledby(char *pattern)
|
||||||
|
case FCNDEF:
|
||||||
|
skiprefchar(); /* match name to pattern */
|
||||||
|
if (match()) {
|
||||||
|
- found_caller = 'y';
|
||||||
|
+ found_caller[0] = 'y';
|
||||||
|
findcalledbysub(file, macro);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- return (&found_caller);
|
||||||
|
+ return (&found_caller[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* find this term, which can be a regular expression */
|
||||||
|
--
|
||||||
|
2.37.3
|
||||||
|
|
@ -0,0 +1,26 @@
|
|||||||
|
diff -up ./src/egrep.c.coverity2 ./src/egrep.c
|
||||||
|
--- ./src/egrep.c.coverity2 2018-10-11 15:22:40.481384312 -0400
|
||||||
|
+++ ./src/egrep.c 2018-10-11 15:23:31.152211589 -0400
|
||||||
|
@@ -1205,6 +1205,7 @@ yyparse (void)
|
||||||
|
# undef YYSTACK_RELOCATE
|
||||||
|
if (yyss1 != yyssa)
|
||||||
|
YYSTACK_FREE (yyss1);
|
||||||
|
+ /* coverity[leaked_storage] */
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
#endif /* no yyoverflow */
|
||||||
|
diff -up ./src/logdir.c.coverity2 ./src/logdir.c
|
||||||
|
--- ./src/logdir.c.coverity2 2018-10-11 15:23:50.009147309 -0400
|
||||||
|
+++ ./src/logdir.c 2018-10-11 15:24:26.279023664 -0400
|
||||||
|
@@ -79,8 +79,10 @@ logdir(char *name)
|
||||||
|
if (line[j] == '\n')
|
||||||
|
break;
|
||||||
|
/* return a null pointer if the whole file has been read */
|
||||||
|
- if (j >= i)
|
||||||
|
+ if (j >= i) {
|
||||||
|
+ (void) close(pwf);
|
||||||
|
return(0);
|
||||||
|
+ }
|
||||||
|
line[++j] = 0; /* terminate the line */
|
||||||
|
(void) lseek(pwf, (long) (j - i), 1); /* point at the next line */
|
||||||
|
p = nextfield(line); /* get the logname */
|
@ -0,0 +1,52 @@
|
|||||||
|
diff -up ./contrib/xcscope/cscope-indexer.help ./contrib/xcscope/cscope-indexer
|
||||||
|
--- ./contrib/xcscope/cscope-indexer.help 2017-12-07 10:45:07.000000000 -0500
|
||||||
|
+++ ./contrib/xcscope/cscope-indexer 2019-06-24 15:46:31.484852474 -0400
|
||||||
|
@@ -80,6 +80,37 @@ RECURSE=
|
||||||
|
VERBOSE=
|
||||||
|
export DIR RECURSE # Need to pass these to subprocesses
|
||||||
|
|
||||||
|
+show_usage() {
|
||||||
|
+
|
||||||
|
+cat << EOF
|
||||||
|
+
|
||||||
|
+ cscope-indexer [ -v ] [-f database_file ] [-i list_file ] [ -l ] [ -r ]
|
||||||
|
+
|
||||||
|
+ where:
|
||||||
|
+
|
||||||
|
+ -f database_file
|
||||||
|
+ Specifies the cscope database file (default: cscope.out).
|
||||||
|
+
|
||||||
|
+ -i list_file
|
||||||
|
+ Specifies the name of the file into which the list of files
|
||||||
|
+ to index is placed (default: cscope.files).
|
||||||
|
+
|
||||||
|
+ -l
|
||||||
|
+ Suppress the generation/updating of the cscope database
|
||||||
|
+ file. Only a list of files is generated.
|
||||||
|
+
|
||||||
|
+ -r
|
||||||
|
+ Recurse into subdirectories to locate files to index.
|
||||||
|
+ Without this option, only the current directory is
|
||||||
|
+ searched.
|
||||||
|
+
|
||||||
|
+ -v
|
||||||
|
+ Be verbose. Output simple progress messages.
|
||||||
|
+
|
||||||
|
+EOF
|
||||||
|
+
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
while [ -n "$1" ]
|
||||||
|
do
|
||||||
|
case "$1" in
|
||||||
|
@@ -110,6 +141,10 @@ do
|
||||||
|
-v)
|
||||||
|
VERBOSE=1
|
||||||
|
;;
|
||||||
|
+ -h|--help)
|
||||||
|
+ show_usage
|
||||||
|
+ exit 0
|
||||||
|
+ ;;
|
||||||
|
*)
|
||||||
|
DIR="$1"
|
||||||
|
;;
|
@ -0,0 +1,385 @@
|
|||||||
|
commit efc92106173b5130e32587f6c788f19f2477051d
|
||||||
|
Author: Neil Horman <nhorman@tuxdriver.com>
|
||||||
|
Date: Fri Jul 27 15:52:49 2018 -0400
|
||||||
|
|
||||||
|
Add make check test harness
|
||||||
|
|
||||||
|
Start adding tests to self test cscope in travis ci
|
||||||
|
|
||||||
|
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
|
||||||
|
|
||||||
|
diff --git a/Makefile.am b/Makefile.am
|
||||||
|
index ae0fc53..d79d44e 100644
|
||||||
|
--- a/Makefile.am
|
||||||
|
+++ b/Makefile.am
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
## Process this file with automake to produce Makefile.in
|
||||||
|
|
||||||
|
-SUBDIRS = doc src contrib
|
||||||
|
+SUBDIRS = doc src contrib tests
|
||||||
|
|
||||||
|
EXTRA_DIST = INSTALL.gnu packages
|
||||||
|
|
||||||
|
diff --git a/configure.in b/configure.in
|
||||||
|
index c51887d..e0a8b1f 100644
|
||||||
|
--- a/configure.in
|
||||||
|
+++ b/configure.in
|
||||||
|
@@ -415,5 +415,5 @@ case "$host_os" in
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
-AC_CONFIG_FILES([Makefile doc/Makefile src/Makefile contrib/Makefile])
|
||||||
|
+AC_CONFIG_FILES([Makefile doc/Makefile src/Makefile contrib/Makefile tests/Makefile])
|
||||||
|
AC_OUTPUT
|
||||||
|
diff --git a/tests/Makefile.am b/tests/Makefile.am
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..2278a71
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/tests/Makefile.am
|
||||||
|
@@ -0,0 +1,7 @@
|
||||||
|
+check_SCRIPTS = check0.sh check1.sh check2.sh \
|
||||||
|
+ check3.sh check4.sh check6.sh \
|
||||||
|
+ check7.sh check8.sh check9.sh
|
||||||
|
+
|
||||||
|
+TESTS = check0.sh check1.sh check2.sh \
|
||||||
|
+ check3.sh check4.sh check6.sh \
|
||||||
|
+ check7.sh check8.sh check9.sh
|
||||||
|
diff --git a/tests/check0.sh b/tests/check0.sh
|
||||||
|
new file mode 100755
|
||||||
|
index 0000000..6c6883b
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/tests/check0.sh
|
||||||
|
@@ -0,0 +1,32 @@
|
||||||
|
+#!/bin/sh
|
||||||
|
+
|
||||||
|
+EXPECT=4
|
||||||
|
+SINDEX=0
|
||||||
|
+STERM=main
|
||||||
|
+STYPE="find C symbol"
|
||||||
|
+
|
||||||
|
+if [ -z "$CSCOPE_BINARY" ]
|
||||||
|
+then
|
||||||
|
+ CSCOPE_BINARY=./src/cscope
|
||||||
|
+fi
|
||||||
|
+
|
||||||
|
+echo "Searching item $SINDEX, '$STYPE', '$STERM'"
|
||||||
|
+
|
||||||
|
+#Get to the top level directory
|
||||||
|
+cd ..
|
||||||
|
+
|
||||||
|
+#Remove any previous databases from testing
|
||||||
|
+rm -f cscope.out
|
||||||
|
+
|
||||||
|
+#Count the number of instances of the string 'Copyright'
|
||||||
|
+#We expect 178 currently
|
||||||
|
+COUNT=$($CSCOPE_BINARY -R -L -k -$SINDEX$STERM | wc -l)
|
||||||
|
+
|
||||||
|
+if [ $COUNT -ne $EXPECT ]
|
||||||
|
+then
|
||||||
|
+ echo "Expected $EXPECT instances of $STYPE $STERM but found $COUNT"
|
||||||
|
+ exit 1
|
||||||
|
+fi
|
||||||
|
+
|
||||||
|
+exit 0
|
||||||
|
+
|
||||||
|
diff --git a/tests/check1.sh b/tests/check1.sh
|
||||||
|
new file mode 100755
|
||||||
|
index 0000000..78ffe21
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/tests/check1.sh
|
||||||
|
@@ -0,0 +1,32 @@
|
||||||
|
+#!/bin/sh
|
||||||
|
+
|
||||||
|
+EXPECT=3
|
||||||
|
+SINDEX=1
|
||||||
|
+STERM=main
|
||||||
|
+STYPE="symbol definition"
|
||||||
|
+
|
||||||
|
+if [ -z "$CSCOPE_BINARY" ]
|
||||||
|
+then
|
||||||
|
+ CSCOPE_BINARY=./src/cscope
|
||||||
|
+fi
|
||||||
|
+
|
||||||
|
+echo "Searching item $SINDEX, '$STYPE', '$STERM'"
|
||||||
|
+
|
||||||
|
+#Get to the top level directory
|
||||||
|
+cd ..
|
||||||
|
+
|
||||||
|
+#Remove any previous databases from testing
|
||||||
|
+rm -f cscope.out
|
||||||
|
+
|
||||||
|
+#Count the number of instances of the string 'Copyright'
|
||||||
|
+#We expect 178 currently
|
||||||
|
+COUNT=$($CSCOPE_BINARY -R -L -k -$SINDEX$STERM | wc -l)
|
||||||
|
+
|
||||||
|
+if [ $COUNT -ne $EXPECT ]
|
||||||
|
+then
|
||||||
|
+ echo "Expected $EXPECT instances of $STYPE $STERM but found $COUNT"
|
||||||
|
+ exit 1
|
||||||
|
+fi
|
||||||
|
+
|
||||||
|
+exit 0
|
||||||
|
+
|
||||||
|
diff --git a/tests/check2.sh b/tests/check2.sh
|
||||||
|
new file mode 100755
|
||||||
|
index 0000000..414430a
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/tests/check2.sh
|
||||||
|
@@ -0,0 +1,30 @@
|
||||||
|
+#!/bin/sh
|
||||||
|
+
|
||||||
|
+EXPECT=96
|
||||||
|
+SINDEX=2
|
||||||
|
+STERM=build
|
||||||
|
+STYPE="functions called by"
|
||||||
|
+
|
||||||
|
+if [ -z "$CSCOPE_BINARY" ]
|
||||||
|
+then
|
||||||
|
+ CSCOPE_BINARY=./src/cscope
|
||||||
|
+fi
|
||||||
|
+
|
||||||
|
+echo "Searching item $SINDEX, '$STYPE', '$STERM'"
|
||||||
|
+
|
||||||
|
+#Get to the top level directory
|
||||||
|
+cd ..
|
||||||
|
+
|
||||||
|
+#Remove any previous databases from testing
|
||||||
|
+rm -f cscope.out
|
||||||
|
+
|
||||||
|
+COUNT=$($CSCOPE_BINARY -R -L -k -$SINDEX$STERM | wc -l)
|
||||||
|
+
|
||||||
|
+if [ $COUNT -ne $EXPECT ]
|
||||||
|
+then
|
||||||
|
+ echo "Expected $EXPECT instances of $STYPE $STERM but found $COUNT"
|
||||||
|
+ exit 1
|
||||||
|
+fi
|
||||||
|
+
|
||||||
|
+exit 0
|
||||||
|
+
|
||||||
|
diff --git a/tests/check3.sh b/tests/check3.sh
|
||||||
|
new file mode 100755
|
||||||
|
index 0000000..a6b2c7e
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/tests/check3.sh
|
||||||
|
@@ -0,0 +1,31 @@
|
||||||
|
+#!/bin/sh
|
||||||
|
+
|
||||||
|
+EXPECT=35
|
||||||
|
+SINDEX=3
|
||||||
|
+STERM=printf
|
||||||
|
+STYPE="functions calling"
|
||||||
|
+
|
||||||
|
+if [ -z "$CSCOPE_BINARY" ]
|
||||||
|
+then
|
||||||
|
+ CSCOPE_BINARY=./src/cscope
|
||||||
|
+fi
|
||||||
|
+
|
||||||
|
+echo "Searching item $SINDEX, '$STYPE', '$STERM'"
|
||||||
|
+
|
||||||
|
+#Get to the top level directory
|
||||||
|
+cd ..
|
||||||
|
+
|
||||||
|
+#Remove any previous databases from testing
|
||||||
|
+rm -f cscope.out
|
||||||
|
+
|
||||||
|
+#We expect 178 currently
|
||||||
|
+COUNT=$($CSCOPE_BINARY -R -L -k -$SINDEX$STERM | wc -l)
|
||||||
|
+
|
||||||
|
+if [ $COUNT -ne $EXPECT ]
|
||||||
|
+then
|
||||||
|
+ echo "Expected $EXPECT instances of $STYPE $STERM but found $COUNT"
|
||||||
|
+ exit 1
|
||||||
|
+fi
|
||||||
|
+
|
||||||
|
+exit 0
|
||||||
|
+
|
||||||
|
diff --git a/tests/check4.sh b/tests/check4.sh
|
||||||
|
new file mode 100755
|
||||||
|
index 0000000..dd2c98c
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/tests/check4.sh
|
||||||
|
@@ -0,0 +1,29 @@
|
||||||
|
+#!/bin/sh
|
||||||
|
+EXPECT=3
|
||||||
|
+SINDEX=4
|
||||||
|
+STERM=oldsigquit
|
||||||
|
+STYPE="regular text string"
|
||||||
|
+
|
||||||
|
+if [ -z "$CSCOPE_BINARY" ]
|
||||||
|
+then
|
||||||
|
+ CSCOPE_BINARY=./src/cscope
|
||||||
|
+fi
|
||||||
|
+
|
||||||
|
+echo "Searching item $SINDEX, '$STYPE', '$STERM'"
|
||||||
|
+
|
||||||
|
+#Get to the top level directory
|
||||||
|
+cd ..
|
||||||
|
+
|
||||||
|
+#Remove any previous databases from testing
|
||||||
|
+rm -f cscope.out
|
||||||
|
+
|
||||||
|
+COUNT=$($CSCOPE_BINARY -R -L -k -$SINDEX$STERM | wc -l)
|
||||||
|
+
|
||||||
|
+if [ $COUNT -ne $EXPECT ]
|
||||||
|
+then
|
||||||
|
+ echo "Expected $EXPECT instances of $STYPE $STERM but found $COUNT"
|
||||||
|
+ exit 1
|
||||||
|
+fi
|
||||||
|
+
|
||||||
|
+exit 0
|
||||||
|
+
|
||||||
|
diff --git a/tests/check6.sh b/tests/check6.sh
|
||||||
|
new file mode 100755
|
||||||
|
index 0000000..c664960
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/tests/check6.sh
|
||||||
|
@@ -0,0 +1,32 @@
|
||||||
|
+#!/bin/sh
|
||||||
|
+
|
||||||
|
+EXPECT=1
|
||||||
|
+SINDEX=6
|
||||||
|
+STERM=msg.*what
|
||||||
|
+STYPE="egrep string"
|
||||||
|
+
|
||||||
|
+if [ -z "$CSCOPE_BINARY" ]
|
||||||
|
+then
|
||||||
|
+ CSCOPE_BINARY=./src/cscope
|
||||||
|
+fi
|
||||||
|
+
|
||||||
|
+echo "Searching item $SINDEX, '$STYPE', '$STERM'"
|
||||||
|
+
|
||||||
|
+#Get to the top level directory
|
||||||
|
+cd ..
|
||||||
|
+
|
||||||
|
+#Remove any previous databases from testing
|
||||||
|
+rm -f cscope.out
|
||||||
|
+
|
||||||
|
+#Count the number of instances of the string 'Copyright'
|
||||||
|
+#We expect 178 currently
|
||||||
|
+COUNT=$($CSCOPE_BINARY -R -L -k -$SINDEX$STERM | wc -l)
|
||||||
|
+
|
||||||
|
+if [ $COUNT -ne $EXPECT ]
|
||||||
|
+then
|
||||||
|
+ echo "Expected $EXPECT instances of $STYPE $STERM but found $COUNT"
|
||||||
|
+ exit 1
|
||||||
|
+fi
|
||||||
|
+
|
||||||
|
+exit 0
|
||||||
|
+
|
||||||
|
diff --git a/tests/check7.sh b/tests/check7.sh
|
||||||
|
new file mode 100755
|
||||||
|
index 0000000..5ac965c
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/tests/check7.sh
|
||||||
|
@@ -0,0 +1,32 @@
|
||||||
|
+#!/bin/sh
|
||||||
|
+
|
||||||
|
+EXPECT=1
|
||||||
|
+SINDEX=7
|
||||||
|
+STERM=main.c
|
||||||
|
+STYPE="file named"
|
||||||
|
+
|
||||||
|
+if [ -z "$CSCOPE_BINARY" ]
|
||||||
|
+then
|
||||||
|
+ CSCOPE_BINARY=./src/cscope
|
||||||
|
+fi
|
||||||
|
+
|
||||||
|
+echo "Searching item $SINDEX, '$STYPE', '$STERM'"
|
||||||
|
+
|
||||||
|
+#Get to the top level directory
|
||||||
|
+cd ..
|
||||||
|
+
|
||||||
|
+#Remove any previous databases from testing
|
||||||
|
+rm -f cscope.out
|
||||||
|
+
|
||||||
|
+#Count the number of instances of the string 'Copyright'
|
||||||
|
+#We expect 178 currently
|
||||||
|
+COUNT=$($CSCOPE_BINARY -R -L -k -$SINDEX$STERM | wc -l)
|
||||||
|
+
|
||||||
|
+if [ $COUNT -ne $EXPECT ]
|
||||||
|
+then
|
||||||
|
+ echo "Expected $EXPECT instances of $STYPE $STERM but found $COUNT"
|
||||||
|
+ exit 1
|
||||||
|
+fi
|
||||||
|
+
|
||||||
|
+exit 0
|
||||||
|
+
|
||||||
|
diff --git a/tests/check8.sh b/tests/check8.sh
|
||||||
|
new file mode 100755
|
||||||
|
index 0000000..72cb946
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/tests/check8.sh
|
||||||
|
@@ -0,0 +1,32 @@
|
||||||
|
+#!/bin/sh
|
||||||
|
+
|
||||||
|
+EXPECT=8
|
||||||
|
+SINDEX=8
|
||||||
|
+STERM=unistd.h
|
||||||
|
+STYPE="files including this file"
|
||||||
|
+
|
||||||
|
+if [ -z "$CSCOPE_BINARY" ]
|
||||||
|
+then
|
||||||
|
+ CSCOPE_BINARY=./src/cscope
|
||||||
|
+fi
|
||||||
|
+
|
||||||
|
+echo "Searching item $SINDEX, '$STYPE', '$STERM'"
|
||||||
|
+
|
||||||
|
+#Get to the top level directory
|
||||||
|
+cd ..
|
||||||
|
+
|
||||||
|
+#Remove any previous databases from testing
|
||||||
|
+rm -f cscope.out
|
||||||
|
+
|
||||||
|
+#Count the number of instances of the string 'Copyright'
|
||||||
|
+#We expect 178 currently
|
||||||
|
+COUNT=$($CSCOPE_BINARY -R -L -k -$SINDEX$STERM | wc -l)
|
||||||
|
+
|
||||||
|
+if [ $COUNT -ne $EXPECT ]
|
||||||
|
+then
|
||||||
|
+ echo "Expected $EXPECT instances of $STYPE $STERM but found $COUNT"
|
||||||
|
+ exit 1
|
||||||
|
+fi
|
||||||
|
+
|
||||||
|
+exit 0
|
||||||
|
+
|
||||||
|
diff --git a/tests/check9.sh b/tests/check9.sh
|
||||||
|
new file mode 100755
|
||||||
|
index 0000000..a728a32
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/tests/check9.sh
|
||||||
|
@@ -0,0 +1,32 @@
|
||||||
|
+#!/bin/sh
|
||||||
|
+
|
||||||
|
+EXPECT=2
|
||||||
|
+SINDEX=9
|
||||||
|
+STERM=reftime
|
||||||
|
+STYPE="assignments to symbol"
|
||||||
|
+
|
||||||
|
+if [ -z "$CSCOPE_BINARY" ]
|
||||||
|
+then
|
||||||
|
+ CSCOPE_BINARY=./src/cscope
|
||||||
|
+fi
|
||||||
|
+
|
||||||
|
+echo "Searching item $SINDEX, '$STYPE', '$STERM'"
|
||||||
|
+
|
||||||
|
+#Get to the top level directory
|
||||||
|
+cd ..
|
||||||
|
+
|
||||||
|
+#Remove any previous databases from testing
|
||||||
|
+rm -f cscope.out
|
||||||
|
+
|
||||||
|
+#Count the number of instances of the string 'Copyright'
|
||||||
|
+#We expect 178 currently
|
||||||
|
+COUNT=$($CSCOPE_BINARY -R -L -k -$SINDEX$STERM | wc -l)
|
||||||
|
+
|
||||||
|
+if [ $COUNT -ne $EXPECT ]
|
||||||
|
+then
|
||||||
|
+ echo "Expected $EXPECT instances of $STYPE $STERM but found $COUNT"
|
||||||
|
+ exit 1
|
||||||
|
+fi
|
||||||
|
+
|
||||||
|
+exit 0
|
||||||
|
+
|
||||||
|
--
|
||||||
|
2.35.1
|
||||||
|
|
@ -0,0 +1,16 @@
|
|||||||
|
diff --git a/contrib/ocs b/contrib/ocs
|
||||||
|
index e924f4f..bd556b4 100755
|
||||||
|
--- a/contrib/ocs
|
||||||
|
+++ b/contrib/ocs
|
||||||
|
@@ -210,7 +210,7 @@ exp_inc()
|
||||||
|
then
|
||||||
|
for i in `cat ${theInc}`
|
||||||
|
do
|
||||||
|
- printf "-I $i "
|
||||||
|
+ printf -- "-I $i "
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.26.2
|
||||||
|
|
@ -0,0 +1,328 @@
|
|||||||
|
Summary: C source code tree search and browse tool
|
||||||
|
Name: cscope
|
||||||
|
Version: 15.9
|
||||||
|
Release: 17%{?dist}
|
||||||
|
Source0: https://downloads.sourceforge.net/project/%{name}/%{name}/v%{version}/%{name}-%{version}.tar.gz
|
||||||
|
URL: http://cscope.sourceforge.net
|
||||||
|
License: BSD and GPLv2+
|
||||||
|
BuildRequires: pkgconf-pkg-config ncurses-devel gcc flex bison m4
|
||||||
|
BuildRequires: autoconf automake make
|
||||||
|
Requires: emacs-filesystem coreutils ed
|
||||||
|
%if !0%{?rhel} && 0%{?fedora} < 36
|
||||||
|
Requires: xemacs-filesystem
|
||||||
|
%endif
|
||||||
|
|
||||||
|
# upstream commits from https://sourceforge.net/p/cscope/cscope/commit_browser
|
||||||
|
Patch1: cscope-1-modified-from-patch-81-Fix-reading-include-files-in-.patch
|
||||||
|
Patch2: cscope-2-Cull-extraneous-declaration.patch
|
||||||
|
Patch3: cscope-3-Avoid-putting-directories-found-during-header-search.patch
|
||||||
|
Patch4: cscope-4-Avoid-double-free-via-double-fclose-in-changestring.patch
|
||||||
|
Patch5: cscope-5-contrib-ocs-Fix-bashims-Closes-480591.patch
|
||||||
|
Patch6: cscope-6-doc-cscope.1-Fix-hyphens.patch
|
||||||
|
Patch7: cscope-7-fscanner-swallow-function-as-parameters.patch
|
||||||
|
# this patch is not needed - RHEL8 has emacs-26.1
|
||||||
|
# Patch8: cscope-8-emacs-plugin-fixup-GNU-Emacs-27.1-removes-function-p.patch
|
||||||
|
Patch9: cscope-9-fix-access-beyond-end-of-string.patch
|
||||||
|
Patch10: cscope-a-docs-typo-fixes-in-man-page-and-comments.patch
|
||||||
|
|
||||||
|
# distrubution patches which were not upstreamed
|
||||||
|
Patch11: dist-1-coverity-fixes.patch
|
||||||
|
Patch12: dist-2-cscope-indexer-help.patch
|
||||||
|
Patch13: dist-3-add-selftests.patch
|
||||||
|
Patch14: dist-4-fix-printf.patch
|
||||||
|
|
||||||
|
%define cscope_share_path %{_datadir}/cscope
|
||||||
|
%if !0%{?rhel} && 0%{?fedora} < 36
|
||||||
|
%define xemacs_lisp_path %{_datadir}/xemacs/site-packages/lisp
|
||||||
|
%else
|
||||||
|
%define xemacs_lisp_path %nil
|
||||||
|
%endif
|
||||||
|
%define emacs_lisp_path %{_datadir}/emacs/site-lisp
|
||||||
|
%define vim_plugin_path %{_datadir}/vim/vimfiles/plugin
|
||||||
|
|
||||||
|
%description
|
||||||
|
cscope is a mature, ncurses based, C source code tree browsing tool. It
|
||||||
|
allows users to search large source code bases for variables, functions,
|
||||||
|
macros, etc, as well as perform general regex and plain text searches.
|
||||||
|
Results are returned in lists, from which the user can select individual
|
||||||
|
matches for use in file editing.
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%autosetup -p1
|
||||||
|
|
||||||
|
%build
|
||||||
|
aclocal
|
||||||
|
autoheader
|
||||||
|
autoconf
|
||||||
|
automake --add-missing
|
||||||
|
%configure
|
||||||
|
make
|
||||||
|
|
||||||
|
%install
|
||||||
|
rm -rf $RPM_BUILD_ROOT %{name}-%{version}.files
|
||||||
|
make DESTDIR=$RPM_BUILD_ROOT install
|
||||||
|
mkdir -p $RPM_BUILD_ROOT/var/lib/cs
|
||||||
|
mkdir -p $RPM_BUILD_ROOT%{cscope_share_path}
|
||||||
|
cp -a contrib/xcscope/xcscope.el $RPM_BUILD_ROOT%{cscope_share_path}
|
||||||
|
install -m 755 contrib/xcscope/cscope-indexer $RPM_BUILD_ROOT%{_bindir}
|
||||||
|
cp -a contrib/cctree.vim $RPM_BUILD_ROOT%{cscope_share_path}
|
||||||
|
for dir in %{xemacs_lisp_path} %{emacs_lisp_path} ; do
|
||||||
|
mkdir -p $RPM_BUILD_ROOT$dir
|
||||||
|
ln -s %{cscope_share_path}/xcscope.el $RPM_BUILD_ROOT$dir
|
||||||
|
touch $RPM_BUILD_ROOT$dir/xcscope.elc
|
||||||
|
echo "%ghost $dir/xcscope.el*" >> %{name}-%{version}.files
|
||||||
|
done
|
||||||
|
|
||||||
|
%check
|
||||||
|
make check
|
||||||
|
|
||||||
|
%files -f %{name}-%{version}.files
|
||||||
|
%{_bindir}/*
|
||||||
|
%dir %{cscope_share_path}
|
||||||
|
%{cscope_share_path}/
|
||||||
|
%{_mandir}/man1/*
|
||||||
|
%dir /var/lib/cs
|
||||||
|
%doc AUTHORS COPYING ChangeLog README TODO contrib/cctree.txt
|
||||||
|
|
||||||
|
%if !0%{?rhel} && 0%{?fedora} < 36
|
||||||
|
%triggerin -- xemacs
|
||||||
|
ln -sf %{cscope_share_path}/xcscope.el %{xemacs_lisp_path}/xcscope.el
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%triggerin -- emacs, emacs-nox, emacs-lucid
|
||||||
|
ln -sf %{cscope_share_path}/xcscope.el %{emacs_lisp_path}/xcscope.el
|
||||||
|
|
||||||
|
%triggerin -- vim-filesystem
|
||||||
|
ln -sf %{cscope_share_path}/cctree.vim %{vim_plugin_path}/cctree.vim
|
||||||
|
|
||||||
|
%if !0%{?rhel} && 0%{?fedora} < 36
|
||||||
|
%triggerun -- xemacs
|
||||||
|
[ $2 -gt 0 ] && exit 0
|
||||||
|
rm -f %{xemacs_lisp_path}/xcscope.el
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%triggerun -- emacs, emacs-nox, emacs-lucid
|
||||||
|
[ $2 -gt 0 ] && exit 0
|
||||||
|
rm -f %{emacs_lisp_path}/xcscope.el
|
||||||
|
|
||||||
|
%triggerun -- vim-filesystem
|
||||||
|
[ $2 -gt 0 ] && exit 0
|
||||||
|
rm -f %{vim_plugin_path}/cctree.vim
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Thu Sep 29 2022 Vladis Dronov <vdronov@redhat.com> - 15.9-17
|
||||||
|
- Update to the upstream git @ 7f2369ac (bz 2129887)
|
||||||
|
|
||||||
|
* Fri Apr 22 2022 Vladis Dronov <vdronov@redhat.com> - 15.9-11
|
||||||
|
- Add another small distrubution patch (bz 2074437)
|
||||||
|
|
||||||
|
* Mon Apr 11 2022 Vladis Dronov <vdronov@redhat.com> - 15.9-10
|
||||||
|
- Add missing upstream patches (bz 2074437)
|
||||||
|
|
||||||
|
* Wed Oct 21 2020 Vladis Dronov <vdronov@redhat.com> - 15.9-9
|
||||||
|
- Remove another fclose() to please covscan (bz1886165)
|
||||||
|
|
||||||
|
* Wed Oct 07 2020 Vladis Dronov <vdronov@redhat.com> - 15.9-8
|
||||||
|
- Fix a double-free in changestring() (bz1886165)
|
||||||
|
- Update Requires to include coreutils and ed
|
||||||
|
- Adjust cscope-coverity-fixes.patch removing the fclose(script) chunk
|
||||||
|
- Adjust BuildRequires and remove trailing spaces
|
||||||
|
- Remove older source version from .gitignore
|
||||||
|
- Rename cscope-invindex-sizing.patch as it is for the older upstream version
|
||||||
|
|
||||||
|
* Tue Jun 25 2019 Neil Horman <nhorman@redhat.com> - 15.9-6
|
||||||
|
- Fix covscan warning (bz 1722404)
|
||||||
|
|
||||||
|
* Mon Jun 24 2019 Neil Horman <nhorman@redhat.com> - 15.9-5
|
||||||
|
- update help for cscope-indexer (bz 1722404)
|
||||||
|
|
||||||
|
* Mon Jun 03 2019 Neil Horman <nhorman@redhat.com> - 15.9-4
|
||||||
|
- Fix cscope version (bz 1685920)
|
||||||
|
|
||||||
|
* Thu Feb 28 2019 Neil Horman <nhorman@redhat.com> - 15.9-3
|
||||||
|
- Add CI test harness (bz 1682353)
|
||||||
|
|
||||||
|
* Fri Oct 12 2018 Neil Horman <nhorman@redhat.com> - 15.9-2
|
||||||
|
- Fix up some coverity scan issues (bz 1602468)
|
||||||
|
|
||||||
|
* Tue Jul 24 2018 Neil Horman <nhorman@redhat.com> - 15.9-1
|
||||||
|
- Update to latest upstream with coverity fixes (bz 1602468)
|
||||||
|
|
||||||
|
* Thu Mar 01 2018 Josh Boyer <jwboyer@fedoraproject.org> - 15.8b-8
|
||||||
|
- Conditionalize xemacs
|
||||||
|
|
||||||
|
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 15.8b-7
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
||||||
|
|
||||||
|
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 15.8b-6
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
|
||||||
|
|
||||||
|
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 15.8b-5
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
|
||||||
|
|
||||||
|
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 15.8b-4
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
|
||||||
|
|
||||||
|
* Mon Nov 28 2016 Neil Horman <nhorman@redhat.com> - 15.8b-3
|
||||||
|
- Changed permissions on cscope-indexer (bz 1399108)
|
||||||
|
|
||||||
|
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 15.8b-2
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
|
||||||
|
|
||||||
|
* Wed Aug 05 2015 Neil Horman <nhorman@redhat.com> - 15.8b-1
|
||||||
|
- Update to latest upstream
|
||||||
|
|
||||||
|
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 15.8-12
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
|
||||||
|
|
||||||
|
* Tue Sep 30 2014 Neil Horman <nhorman@redhat.com> - 15.8-11
|
||||||
|
- Added triggerin support for emacs-nox (bz 961709)
|
||||||
|
|
||||||
|
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 15.8-10
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
|
||||||
|
|
||||||
|
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 15.8-9
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
|
||||||
|
|
||||||
|
* Tue Apr 15 2014 Neil Horman <nhorman@redhat.com> - 15.8-8
|
||||||
|
- Fixed formatting issue with empty function array (bz 1087940)
|
||||||
|
|
||||||
|
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 15.8-7
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
|
||||||
|
|
||||||
|
* Mon Mar 25 2013 Neil Horman <nhorman@redhat.com> - 15.8-6
|
||||||
|
- Fixed build break
|
||||||
|
|
||||||
|
* Mon Mar 25 2013 Neil Horman <nhorman@redhat.com> - 15.8-5
|
||||||
|
- Updated to run autoreconf for impending aarch64 introduction (bz 925201)
|
||||||
|
|
||||||
|
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 15.8-4
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
|
||||||
|
|
||||||
|
* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 15.8-3
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
|
||||||
|
|
||||||
|
* Tue Jul 10 2012 Neil Horman <nhorman@redhat.com> - 15.8-2
|
||||||
|
- Fix inverted index sizing
|
||||||
|
|
||||||
|
* Mon Jun 18 2012 Neil Horman <nhorman@redhat.com> - 15.8
|
||||||
|
- Update to latest upstream
|
||||||
|
|
||||||
|
* Mon Mar 12 2012 Neil Horman <nhorman@redhat.com> -15.7a-10
|
||||||
|
- Fixed a segfault in invlib construction ( bz 786523)
|
||||||
|
|
||||||
|
* Mon Mar 05 2012 Neil Horman <nhorman@redhat.com> 15.7a-9
|
||||||
|
- Fixed a segfault in the symbol assignment search (bz 799643)
|
||||||
|
|
||||||
|
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 15.7a-8
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
|
||||||
|
|
||||||
|
* Thu Jun 30 2011 Neil Horman <nhorman@redhat.com> - 15.7a-7
|
||||||
|
- Added LEXERR token to catch bad parsing before we crash (bz717545)
|
||||||
|
|
||||||
|
* Fri Jun 24 2011 Neil Horman <nhorman@redhat.com> - 15.7a-6
|
||||||
|
- Fixed licensing for xcscope.el (bz 715898)
|
||||||
|
- Fixed xemacs pkg. dependency (bz 719523)
|
||||||
|
|
||||||
|
* Wed Jun 01 2011 Neil Horman <nhorman@redhat.com> - 15.7a-5
|
||||||
|
- Fix scriptles macro expansion (bz 708499)
|
||||||
|
|
||||||
|
* Thu May 26 2011 Neil Horman <nhorman@redhat.com> - 15.7a-4
|
||||||
|
- Added cctree.vim vi plugin
|
||||||
|
|
||||||
|
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 15.7a-3
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
|
||||||
|
|
||||||
|
* Thu Sep 30 2010 Neil Horman <nhorman@redhat.com - 15.7a-2
|
||||||
|
- Ignore SIGPIPE in line mode (bz 638756)
|
||||||
|
|
||||||
|
* Mon Mar 1 2010 Neil Horman <nhorman@redhat.com> - 15.7a-1
|
||||||
|
- Update to latest upstream release (bz 569043)
|
||||||
|
|
||||||
|
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 15.6-5
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
|
||||||
|
|
||||||
|
* Fri Jun 12 2009 Neil Horman <nhorman@redhat.com>
|
||||||
|
- Fix some buffer overflows (bz 505605)
|
||||||
|
|
||||||
|
* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 15.6-3
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
|
||||||
|
|
||||||
|
* Tue Jul 08 2008 Neil Horman <nhorman@redhat.com> -15.6-2.dist
|
||||||
|
- Grab upstream patch for -q rebuld (bz 436648)
|
||||||
|
|
||||||
|
* Tue Mar 27 2007 Neil Horman <nhorman@redhat.com> -15.6-1.dist
|
||||||
|
- Rebase to version 15.6
|
||||||
|
|
||||||
|
* Mon Mar 05 2007 Neil Horman <nhorman@redhat.com> -15.5-15.4.dist
|
||||||
|
- Make sigwinch handler only register for curses mode (bz 230862)
|
||||||
|
|
||||||
|
* Mon Feb 05 2007 Neil Horman <nhorman@redhat.com> -15.5-15.3.dist
|
||||||
|
- Fixing dist label in release tag.
|
||||||
|
|
||||||
|
* Thu Feb 01 2007 Neil Horman <nhorman@redhat.com> -15.5-15.2.dist
|
||||||
|
- Fixing changelog to not have macro in release
|
||||||
|
|
||||||
|
* Wed Aug 23 2006 Neil Horman <nhorman@redhat.com> -15.5-15.1
|
||||||
|
- fixed overflows per bz 203651
|
||||||
|
- start using {dist} tag to make release numbering easier
|
||||||
|
|
||||||
|
* Mon Jul 17 2006 Jesse Keating <jkeating@redhat.com> - 15.5-14
|
||||||
|
- rebuild
|
||||||
|
|
||||||
|
* Fri Jun 23 2006 Neil Horman <nhorman@redhat.com>
|
||||||
|
- Fix putstring overflow (bz 189666)
|
||||||
|
|
||||||
|
* Fri Jun 23 2006 Neil Horman <nhorman@redhat.com>
|
||||||
|
- Fix putstring overflow (bz 189666)
|
||||||
|
|
||||||
|
* Fri May 5 2006 Neil Horman <nhorman@redhat.com>
|
||||||
|
- Adding fix to put SYSDIR in right location (bz190580)
|
||||||
|
|
||||||
|
* Fri Apr 21 2006 Neil Horman <nhorman@redhat.com> - 15.5-13.4
|
||||||
|
- adding inverted index overflow patch
|
||||||
|
|
||||||
|
* Fri Feb 10 2006 Jesse Keating <jkeating@redhat.com> - 15.5-13.2
|
||||||
|
- bump again for double-long bug on ppc(64)
|
||||||
|
|
||||||
|
* Tue Feb 07 2006 Jesse Keating <jkeating@redhat.com> - 15.5-13.1
|
||||||
|
- rebuilt for new gcc4.1 snapshot and glibc changes
|
||||||
|
|
||||||
|
* Fri Dec 16 2005 Jesse Keating <jkeating@redhat.com>
|
||||||
|
- rebuild on new gcc
|
||||||
|
|
||||||
|
* Tue Nov 30 2004 Neil Horman <nhorman@redhat.com>
|
||||||
|
- added tempsec patch to fix bz140764/140765
|
||||||
|
|
||||||
|
* Mon Nov 29 2004 Neil Horman <nhorman@redhat.com>
|
||||||
|
- updated cscope resize patch to do less work in
|
||||||
|
signal handler and synced version nr. on dist.
|
||||||
|
|
||||||
|
* Mon Nov 22 2004 Neil Horman <nhorman@redhat.com>
|
||||||
|
- added cscope-1.5.-resize patch to allow terminal
|
||||||
|
resizing while cscope is running
|
||||||
|
|
||||||
|
* Tue Oct 5 2004 Neil Horman <nhorman@redhat.com>
|
||||||
|
- modified cscope-15.5.-inverted patch to be upstream
|
||||||
|
friendly
|
||||||
|
|
||||||
|
* Tue Sep 28 2004 Neil Horman <nhorman@redhat.com>
|
||||||
|
- fixed inverted index bug (bz 133942)
|
||||||
|
|
||||||
|
* Mon Sep 13 2004 Frank Ch. Eigler <fche@redhat.com>
|
||||||
|
- bumped release number to a plain "1"
|
||||||
|
|
||||||
|
* Fri Jul 16 2004 Neil Horman <nhorman@redhat.com>
|
||||||
|
- Added cscope-indexer helper and xcscope lisp addon
|
||||||
|
- Added man page for xcscope
|
||||||
|
- Added triggers to add xcscope.el pkg to (x)emacs
|
||||||
|
- Thanks to Ville, Michael and Jens for thier help :)
|
||||||
|
|
||||||
|
* Fri Jul 2 2004 Neil Horman <nhorman@redhat.com>
|
||||||
|
- Added upstream ocs fix
|
||||||
|
- Added feature to find symbol assignments
|
||||||
|
- Changed default SYSDIR directory to /var/lib/cs
|
||||||
|
- Incoproated M. Schwendt's fix for ocs -s
|
||||||
|
|
||||||
|
* Fri Jun 18 2004 Neil Horman <nhorman@redhat.com>
|
||||||
|
- built the package
|
Loading…
Reference in new issue