Feature Requests item #3587158, was opened at 2012-11-14 08:22
Message generated for change (Comment added) made by bcasavan
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=354664&aid=3587158&group_id=4664
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Neil Horman (nhorman)
Summary: DOS Style line ending brakes display output
Initial Comment:
DOS Style line ending brakes display output. The match is detected but not
displayed. See the attached mock-up source tree. egrep for MYMAP_ the search
matches '1' and '2' are not visible, but "operational". A better fix should run
the characters of 'tempstring' , if there are non-displayable chars it should
still display the file name, function, and line number, but replace the matched
text with ellipsis.
Proposed change:
Index: display.c
===================================================================
RCS file: /cvsroot/cscope/cscope/src/display.c,v
retrieving revision 1.33
diff -u -r1.33 display.c
--- display.c 20 May 2012 12:24:17 -0000 1.33
+++ display.c 14 Nov 2012 16:16:00 -0000
@@ -229,6 +229,12 @@
linenum, tempstring) < 4) {
break;
}
+ {
+ char *cr = strchr( tempstring, '\r' );
+ if( cr ) {
+ *cr = 0;
+ }
+ }
++nextline;
displine[disprefs] = screenline;
----------------------------------------------------------------------
Comment By: Brent Casavant (bcasavan)
Date: 2012-12-04 15:37
Message:
Sorry for the mangled patch -- I'm kind of new to sourceforge and couldn't
find a better way to include it here. Just look carefully for the change
of "[^\n]" to "[^\r\n]" just after TEMPSTRING_LEN_STR. This affects only
the display of the output line -- it doesn't affect the actual underlying
cscope database or other internal representation, so it targets just the
issue in question and nothing more.
----------------------------------------------------------------------
Comment By: Brent Casavant (bcasavan)
Date: 2012-12-04 15:31
Message:
I know this subject has been discussed before, however I too would like to
request that this capability be added.
It is a vital capability to have if a person is doing cross-platform
development that spans UNIX-like and DOS-like systems, where no matter
which end-of-line convention you choose to use in your source files the
display in cscope is mangled.
I have a much simpler patch than the original submitter that I hope can be
considered for inclusion:
diff -ruN cscope-15.8a/src/display.c cscope/src/display.c
--- cscope-15.8a/src/display.c 2012-05-20 07:24:17.000000000 -0500
+++ cscope/src/display.c 2012-12-04 17:17:01.500165190 -0600
@@ -225,7 +225,7 @@
disprefs < mdisprefs && screenline <= lastdispline;
++disprefs, ++screenline) {
/* read the reference line */
- if (fscanf(refsfound, "%" PATHLEN_STR "s%" PATHLEN_STR "s%"
NUMLEN_STR "s %" TEMPSTRING_LEN_STR "[^\n]", file, function,
+ if (fscanf(refsfound, "%" PATHLEN_STR "s%" PATHLEN_STR "s%"
NUMLEN_STR "s %" TEMPSTRING_LEN_STR "[^\r\n]", file, function,
linenum, tempstring) < 4) {
break;
}
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=354664&aid=3587158&group_id=4664
------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Cscope-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cscope-devel