From owner-freebsd-current@FreeBSD.ORG Thu Aug 5 04:53:16 2010 Return-Path: Delivered-To: current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 644DF1065672 for ; Thu, 5 Aug 2010 04:53:16 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from server.mypc.hu (server.mypc.hu [87.229.73.95]) by mx1.freebsd.org (Postfix) with ESMTP id 1C3708FC17 for ; Thu, 5 Aug 2010 04:53:15 +0000 (UTC) Received: from server.mypc.hu (localhost [127.0.0.1]) by server.mypc.hu (Postfix) with ESMTP id D8EE214DC4B9; Thu, 5 Aug 2010 06:53:13 +0200 (CEST) X-Virus-Scanned: amavisd-new at server.mypc.hu Received: from server.mypc.hu ([127.0.0.1]) by server.mypc.hu (server.mypc.hu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id jWGewbjKuKng; Thu, 5 Aug 2010 06:53:11 +0200 (CEST) Received: from [192.168.1.105] (catv-80-99-92-167.catv.broadband.hu [80.99.92.167]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by server.mypc.hu (Postfix) with ESMTPSA id 8204E14DC4B6; Thu, 5 Aug 2010 06:53:10 +0200 (CEST) Message-ID: <4C5A43B0.3080203@FreeBSD.org> Date: Thu, 05 Aug 2010 06:53:04 +0200 From: Gabor Kovesdan User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-PT; rv:1.9.1.10) Gecko/20100512 Thunderbird/3.0.5 MIME-Version: 1.0 To: d@delphij.net References: <86eiefhalp.wl%poyopoyo@puripuri.plala.or.jp> <4C585E44.5030608@FreeBSD.org> <4C59AC17.5000200@delphij.net> In-Reply-To: <4C59AC17.5000200@delphij.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: poyopoyo@puripuri.plala.or.jp, Xin LI , current@FreeBSD.org Subject: Re: bsdgrep does not work with tail -f | grep combination X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Aug 2010 04:53:16 -0000 Em 2010.08.04. 20:06, Xin LI escreveu: > I'm able to reproduce the GNU behavior on 9.0-CURRENT which is IMO right. > > I think we need to break at the line end to provide better interactivity > (the current code seems to do it (buffer is not full&& !eof), while > what we wanted is (buffer is not full&& !eof&& !eol). > > The attached patch should fix this but I have not yet thoroughly tested > it due to job work. > > I think the patch may break binary detection. That buffer is not a general buffer but filled in only once with the first n bytes of the file to check if the file is binary. If you stop after the first line, only the first line will be used for binary checking. I'll look at this problem soon. Gabor