From owner-p4-projects@FreeBSD.ORG Wed Jul 23 11:15:05 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 038321065675; Wed, 23 Jul 2008 11:15:05 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB7361065671 for ; Wed, 23 Jul 2008 11:15:04 +0000 (UTC) (envelope-from gabor@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id BC4728FC18 for ; Wed, 23 Jul 2008 11:15:04 +0000 (UTC) (envelope-from gabor@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m6NBF4rK071764 for ; Wed, 23 Jul 2008 11:15:04 GMT (envelope-from gabor@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.2/8.14.1/Submit) id m6NBF4MP071762 for perforce@freebsd.org; Wed, 23 Jul 2008 11:15:04 GMT (envelope-from gabor@freebsd.org) Date: Wed, 23 Jul 2008 11:15:04 GMT Message-Id: <200807231115.m6NBF4MP071762@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to gabor@freebsd.org using -f From: Gabor Kovesdan To: Perforce Change Reviews Cc: Subject: PERFORCE change 145703 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jul 2008 11:15:05 -0000 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; }