PERFORCE change 156668 for review

Gabor Kovesdan gabor at FreeBSD.org
Sun Jan 25 15:29:48 PST 2009


http://perforce.freebsd.org/chv.cgi?CH=156668

Change 156668 by gabor at gabor_server on 2009/01/25 23:28:52

	- Implement --strip-trailing-cr
	- Remove debug line

Affected files ...

.. //depot/projects/soc2008/gabor_textproc/diff/diffreg.c#8 edit

Differences ...

==== //depot/projects/soc2008/gabor_textproc/diff/diffreg.c#8 (text+ko) ====

@@ -779,15 +779,11 @@
 				    (c == '\n' && d == EOF))) {
 					break;
 				}
-				if ((strip_cr) &&
-				    ((c == EOF && d == '\r') ||
-				    (c == '\r' && d == EOF)))
-					break;
 				ctold++;
 				ctnew++;
-				while ((strip_cr) && (c == '\r'))
+				while ((strip_cr) && (c == '\r') && (d == '\n'))
 					c = getc(f1);
-				while ((strip_cr) && (d == '\r'))
+				while ((strip_cr) && (d == '\r') && (c == '\n'))
 					d = getc(f2);
 				if (bflag && isspace(c) && isspace(d)) {
 					do {
@@ -1288,7 +1284,6 @@
 	 * There is a remote possibility that we end up with a zero sum.
 	 * Zero is used as an EOF marker, so return 1 instead.
 	 */
-	printf("HASH: %d\n", (sum == 0 ? 1 : sum));
 	return (sum == 0 ? 1 : sum);
 }
 


More information about the p4-projects mailing list