Date: Wed, 23 Jul 2008 11:15:04 GMT From: Gabor Kovesdan <gabor@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 145703 for review Message-ID: <200807231115.m6NBF4MP071762@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=145703 Change 145703 by gabor@gabor_server on 2008/07/23 11:14:41 - Reset read buffer before processing a file to avoid reading false data from the buffer when doing recursive greps Affected files ... .. //depot/projects/soc2008/gabor_textproc/grep/file.c#24 edit .. //depot/projects/soc2008/gabor_textproc/grep/grep.h#39 edit .. //depot/projects/soc2008/gabor_textproc/grep/util.c#67 edit Differences ... ==== //depot/projects/soc2008/gabor_textproc/grep/file.c#24 (text+ko) ==== @@ -57,7 +57,7 @@ static size_t lnbuflen; static char binbuf[BUFSIZ * 4]; static int binbufsiz; -static char *binbufptr; +char *binbufptr; static int bzerr; #define iswbinary(ch) (!iswspace((ch)) && iswcntrl((ch)) && (ch != L'\b') && (ch != L'\0')) ==== //depot/projects/soc2008/gabor_textproc/grep/grep.h#39 (text+ko) ==== @@ -130,6 +130,8 @@ void clearqueue(void); /* file.c */ +char *binbufptr; + void grep_close(struct file *f); struct file *grep_stdin_open(void); struct file *grep_open(char *path); ==== //depot/projects/soc2008/gabor_textproc/grep/util.c#67 (text+ko) ==== @@ -114,6 +114,8 @@ } else ok = 1; if (ok) + /* Reset read buffer before reading other file */ + binbufptr = NULL; c += procfile(p->fts_path); break; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200807231115.m6NBF4MP071762>