cscope/cscope-egrep.out.patch

32 lines
815 B
Diff
Raw Normal View History

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