|
From: Hans-Bernhard B. <br...@us...> - 2002-10-29 16:45:52
|
Update of /cvsroot/cscope/cscope/src
In directory usw-pr-cvs1:/tmp/cvs-serv24988/src
Modified Files:
display.c main.c
Log Message:
Two bugfixes: Missing $HOME, and single very long line output
Index: display.c
===================================================================
RCS file: /cvsroot/cscope/cscope/src/display.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -r1.20 -r1.21
*** display.c 13 Mar 2002 18:54:40 -0000 1.20
--- display.c 29 Oct 2002 16:45:50 -0000 1.21
***************
*** 163,177 ****
move(0, COLS - (int) sizeof(helpstring));
addstr(helpstring);
! }
! /* if no references were found */
! else if (totallines == 0) {
/* redisplay the last message */
addstr(lastmsg);
! }
! else { /* display the pattern */
if (changing == YES) {
printw("Change \"%s\" to \"%s\"", pattern, newpat);
! }
! else {
printw("%c%s: %s", toupper((unsigned char)fields[field].text2[0]),
fields[field].text2 + 1, pattern);
--- 163,175 ----
move(0, COLS - (int) sizeof(helpstring));
addstr(helpstring);
! } else if (totallines == 0) {
! /* if no references were found */
/* redisplay the last message */
addstr(lastmsg);
! } else {
! /* display the pattern */
if (changing == YES) {
printw("Change \"%s\" to \"%s\"", pattern, newpat);
! } else {
printw("%c%s: %s", toupper((unsigned char)fields[field].text2[0]),
fields[field].text2 + 1, pattern);
***************
*** 211,221 ****
width -= fcnlen + 1;
}
/* until the max references have been displayed or
there is no more room */
topline = nextline;
for (disprefs = 0, screenline = REFLINE;
! disprefs < mdisprefs && screenline <= lastdispline;
! ++disprefs, ++screenline) {
!
/* read the reference line */
if (fscanf(refsfound, "%s%s%s %[^\n]", file, function,
--- 209,219 ----
width -= fcnlen + 1;
}
+
/* until the max references have been displayed or
there is no more room */
topline = nextline;
for (disprefs = 0, screenline = REFLINE;
! disprefs < mdisprefs && screenline <= lastdispline;
! ++disprefs, ++screenline) {
/* read the reference line */
if (fscanf(refsfound, "%s%s%s %[^\n]", file, function,
***************
*** 229,235 ****
if (mouse == YES) {
addch(' ');
! }
! else
printw("%c", dispchars[disprefs]);
/* display any change mark */
--- 227,233 ----
if (mouse == YES) {
addch(' ');
! } else {
printw("%c", dispchars[disprefs]);
+ }
/* display any change mark */
***************
*** 237,249 ****
change[topline + disprefs - 1] == YES) {
addch('>');
! }
! else {
addch(' ');
}
/* display the file name */
if (field == FILENAME) {
printw("%-*s ", filelen, file);
! }
! else {
/* if OGS, display the subsystem and book names */
if (ogs == YES) {
--- 235,246 ----
change[topline + disprefs - 1] == YES) {
addch('>');
! } else {
addch(' ');
}
+
/* display the file name */
if (field == FILENAME) {
printw("%-*s ", filelen, file);
! } else {
/* if OGS, display the subsystem and book names */
if (ogs == YES) {
***************
*** 257,261 ****
pathcomponents(file, dispcomponents));
}
! }
/* display the function name */
if (field == SYMBOL || field == CALLEDBY || field == CALLING) {
--- 254,259 ----
pathcomponents(file, dispcomponents));
}
! } /* else(field == FILENAME) */
!
/* display the function name */
if (field == SYMBOL || field == CALLEDBY || field == CALLING) {
***************
*** 266,279 ****
continue;
}
/* display the line number */
printw("%*s ", numlen, linenum);
-
/* there may be tabs in egrep output */
while ((s = strchr(tempstring, '\t')) != NULL) {
*s = ' ';
}
/* display the source line */
s = tempstring;
-
for (;;) {
/* see if the source line will fit */
--- 264,277 ----
continue;
}
+
/* display the line number */
printw("%*s ", numlen, linenum);
/* there may be tabs in egrep output */
while ((s = strchr(tempstring, '\t')) != NULL) {
*s = ' ';
}
+
/* display the source line */
s = tempstring;
for (;;) {
/* see if the source line will fit */
***************
*** 310,313 ****
--- 308,313 ----
display what will fit on the screen */
if (topline == nextline -1) {
+ disprefs++;
+ /* break out of two loops */
goto endrefs;
}
***************
*** 327,333 ****
/* indent the continued source line */
move(screenline, COLS - width);
! }
!
! }
endrefs:
/* position the cursor for the message */
--- 327,332 ----
/* indent the continued source line */
move(screenline, COLS - width);
! } /* for(ever) */
! } /* for(reference output lines) */
endrefs:
/* position the cursor for the message */
Index: main.c
===================================================================
RCS file: /cvsroot/cscope/cscope/src/main.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -r1.27 -r1.28
*** main.c 28 Jul 2002 15:40:07 -0000 1.27
--- main.c 29 Oct 2002 16:45:50 -0000 1.28
***************
*** 54,57 ****
--- 54,58 ----
/* defaults for unset environment variables */
#define EDITOR "vi"
+ #define HOME "/" /* no $HOME --> use root directory */
#define SHELL "sh"
#define LINEFLAG "+%s" /* default: used by vi and emacs */
***************
*** 298,302 ****
editor = mygetenv("VIEWER", editor); /* use viewer if set */
editor = mygetenv("CSCOPE_EDITOR", editor); /* has last word */
! home = getenv("HOME");
shell = mygetenv("SHELL", SHELL);
lineflag = mygetenv("CSCOPE_LINEFLAG", LINEFLAG);
--- 299,303 ----
editor = mygetenv("VIEWER", editor); /* use viewer if set */
editor = mygetenv("CSCOPE_EDITOR", editor); /* has last word */
! home = mygetenv("HOME", HOME);
shell = mygetenv("SHELL", SHELL);
lineflag = mygetenv("CSCOPE_LINEFLAG", LINEFLAG);
|