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
This commit is contained in:
Petr Uzel 2011-06-23 14:44:07 +00:00 committed by Git OBS Bridge
parent 2ca9fafccd
commit bd0ae23d58
4 changed files with 87 additions and 1 deletions

43
cscope-ctrlz.patch Normal file
View File

@ -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();

31
cscope-egrep.out.patch Normal file
View File

@ -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)

View File

@ -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

View File

@ -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}}