From bd0ae23d58c8589fedc00c481fe75908d4735375d079406c5143fe48d82e3e99 Mon Sep 17 00:00:00 2001 From: Petr Uzel Date: Thu, 23 Jun 2011 14:44:07 +0000 Subject: [PATCH] Accepting request 74406 from home:rhcoe:branches:devel:tools cscope: fix egrep text output; restore control-z function OBS-URL: https://build.opensuse.org/request/show/74406 OBS-URL: https://build.opensuse.org/package/show/devel:tools/cscope?expand=0&rev=5 --- cscope-ctrlz.patch | 43 ++++++++++++++++++++++++++++++++++++++++++ cscope-egrep.out.patch | 31 ++++++++++++++++++++++++++++++ cscope.changes | 8 ++++++++ cscope.spec | 6 +++++- 4 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 cscope-ctrlz.patch create mode 100644 cscope-egrep.out.patch diff --git a/cscope-ctrlz.patch b/cscope-ctrlz.patch new file mode 100644 index 0000000..51b3b8f --- /dev/null +++ b/cscope-ctrlz.patch @@ -0,0 +1,43 @@ +# restore control-z functionality of interactive cscope. +# version 15.6 (and previous) had control-z functionality because +# the terminal was in cbreak mode. Putting the terminal in raw mode +# fixed using control-c to change the 'ignore case mode'. +# catch the control-z and send ourself the suspend signal. +# rcoe@wi.rr.com +# +--- cscope-15.7a/src/command.c 2009-04-10 08:40:36.000000000 -0500 ++++ cscope-15.7a.orig/src/command.c 2011-06-10 09:33:21.862932467 -0500 +@@ -634,11 +634,13 @@ changestring(void) + atchange(); + + /* get a character from the terminal */ +- if ((c = mygetch()) == EOF +- || c == ctrl('D') +- || c == ctrl('Z')) { ++ if ((c = mygetch()) == EOF || c == ctrl('D')) { + break; /* change lines */ + } ++ if (c == ctrl('Z')) { ++ kill(0, SIGTSTP); ++ goto same; ++ } + /* see if the input character is a command */ + switch (c) { + case ' ': /* display next page */ +--- cscope-15.7a/src/main.c 2011-06-09 15:36:06.275174224 -0500 ++++ cscope-15.7a.orig/src/main.c 2011-06-10 09:39:17.120599658 -0500 +@@ -707,9 +707,13 @@ cscope: cannot read source file name fro + atfield(); /* move to the input field */ + + /* exit if the quit command is entered */ +- if ((c = mygetch()) == EOF || c == ctrl('D') || c == ctrl('Z')) { ++ if ((c = mygetch()) == EOF || c == ctrl('D')) { + break; + } ++ if (c == ctrl('Z')) { ++ kill(0, SIGTSTP); ++ continue; ++ } + /* execute the commmand, updating the display if necessary */ + if (command(c) == YES) { + display(); diff --git a/cscope-egrep.out.patch b/cscope-egrep.out.patch new file mode 100644 index 0000000..20899eb --- /dev/null +++ b/cscope-egrep.out.patch @@ -0,0 +1,31 @@ +# on sources that have '\r\n' in them, egrep produces no output +# strip the carriage return out of the output +# rcoe@wi.rr.com +# +--- cscope-15.7a/src/egrep.y 2008-03-12 15:43:56.000000000 -0500 ++++ cscope-15.7a.orig/src/egrep.y 2011-06-09 15:32:08.809669622 -0500 +@@ -592,12 +592,22 @@ egrep(char *file, FILE *output, char *fo + succeed: + fprintf(output, format, file, lnum); + if (p <= nlp) { +- while (nlp < &buf[2*BUFSIZ]) ++ while (nlp < &buf[2*BUFSIZ]) { ++ if ('\r' == *nlp) { ++ nlp++; ++ continue; ++ } + putc(*nlp++, output); ++ } + nlp = buf; + } +- while (nlp < p) ++ while (nlp < p) { ++ if ('\r' == *nlp) { ++ nlp++; ++ continue; ++ } + putc(*nlp++, output); ++ } + lnum++; + nlp = p; + if ((out[(cstat=istat)]) == 0) diff --git a/cscope.changes b/cscope.changes index 6818f31..f733914 100644 --- a/cscope.changes +++ b/cscope.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed Jun 22 11:40:10 CDT 2011 - rcoe@wi.rr.com + +- fix carriage return in egrep output + - added egrep.out patch (bnc#699156) +- fix control-z in interactive curses mode + - added ctrlz patch (bnc#699317) + ------------------------------------------------------------------- Fri Apr 29 12:26:43 UTC 2011 - puzel@novell.com diff --git a/cscope.spec b/cscope.spec index 3a5ed8b..b4c54c6 100644 --- a/cscope.spec +++ b/cscope.spec @@ -19,7 +19,7 @@ Name: cscope Version: 15.7a -Release: 11 +Release: 12 License: BSD3c Summary: Interactive Tool for Browsing C Source Code Url: http://cscope.sourceforge.net/ @@ -29,6 +29,8 @@ Patch1: %{name}-null.patch Patch2: %{name}-15.7-gcc-warnings.patch Patch3: %{name}-15.7-vpath.patch Patch5: %{name}-cleanup_on_sigterm.patch +Patch6: %{name}-egrep.out.patch +Patch7: %{name}-ctrlz.patch BuildRequires: bison BuildRequires: flex BuildRequires: ncurses-devel @@ -44,6 +46,8 @@ browse through C source code files for specified elements of code. %patch2 %patch3 %patch5 +%patch6 -p1 +%patch7 -p1 %build %{?suse_update_config:%{suse_update_config}}