PERFORCE change 145719 for review

Gabor Kovesdan gabor at FreeBSD.org
Wed Jul 23 15:28:25 UTC 2008


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

Change 145719 by gabor at gabor_server on 2008/07/23 15:27:58

	- Move the previous fix to the right place

Affected files ...

.. //depot/projects/soc2008/gabor_textproc/grep/file.c#26 edit

Differences ...

==== //depot/projects/soc2008/gabor_textproc/grep/file.c#26 (text+ko) ====

@@ -129,8 +129,10 @@
 		/* Only pre-read to the buffer if we need the binary check. */
 		if (binbehave != BINFILE_TEXT) {
 			for (; i < (BUFSIZ * sizeof(wint_t)); i++) {
-				if (grep_feof(f))
+				if (grep_feof(f)) {
+					i--;
 					break;
+				}
 				ch = grep_fgetc(f);
 				binbuf[i] = ch;
 			}
@@ -156,10 +158,8 @@
 	/* Read a line whether from the buffer or from the file itself. */
 	for (i = 0; ; i++) {
 		if (binbufptr == &binbuf[binbufsiz]) {
-			if (grep_feof(f)) {
-				i--;
+			if (grep_feof(f))
 				break;
-			}
 			ch = grep_fgetc(f);
 		} else {
 			ch = binbufptr[0];


More information about the p4-projects mailing list