Date: Wed, 23 Jul 2008 15:28:25 GMT From: Gabor Kovesdan <gabor@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 145719 for review Message-ID: <200807231528.m6NFSPIb006642@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=145719 Change 145719 by gabor@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];
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200807231528.m6NFSPIb006642>