PERFORCE change 145703 for review
Gabor Kovesdan
gabor at FreeBSD.org
Wed Jul 23 11:15:05 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=145703
Change 145703 by gabor at 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;
}
More information about the p4-projects
mailing list