From owner-freebsd-current@FreeBSD.ORG Tue Jun 24 21:30:22 2008 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 0C8341065672; Tue, 24 Jun 2008 21:30:22 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (nagual.pp.ru [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 8648E8FC23; Tue, 24 Jun 2008 21:30:21 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.14.2/8.14.2) with ESMTP id m5OLUKb5071852; Wed, 25 Jun 2008 01:30:20 +0400 (MSD) (envelope-from ache@nagual.pp.ru) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nagual.pp.ru; s=default; t=1214343020; bh=iFHpIf9h16J1BINZNUZYFajtSgUdxtYiP0IEQMT 9H7k=; l=475; h=Date:From:To:Subject:Message-ID:References: MIME-Version:Content-Type:In-Reply-To; b=ps5MoCJY+bNPt2HZUKfNU9DqV lwRWEdRb3x9Th1haagcae3CiZbGr/2SR3CAHfpdFbtx0gBjcSYZLAT6PwOVfVB06gs1 qDTFkmeiAt1cQH1moeYMd4er1rO3Lg/sp5C6MzJxgbFfNncmmbQ2bkzDBgjLULSD32J XAMz19fMtcBg= Received: (from ache@localhost) by nagual.pp.ru (8.14.2/8.14.2/Submit) id m5OLUJSO071851; Wed, 25 Jun 2008 01:30:19 +0400 (MSD) (envelope-from ache) Date: Wed, 25 Jun 2008 01:30:18 +0400 From: Andrey Chernov To: Gabor Kovesdan , hackers@FreeBSD.org, current@FreeBSD.org Message-ID: <20080624213018.GA71334@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , Gabor Kovesdan , hackers@FreeBSD.org, current@FreeBSD.org References: <86zlpjduew.fsf@ds4.des.no> <20080618083739.GA87100@nagual.pp.ru> <867icndqv5.fsf@ds4.des.no> <4858DBF6.5070001@bluemedia.pl> <86skvbc9gn.fsf@ds4.des.no> <20080618114917.GB89383@nagual.pp.ru> <485E4C69.1080805@FreeBSD.org> <20080622135343.GA72068@nagual.pp.ru> <486159D1.3060704@FreeBSD.org> <20080624210420.GA43007@nagual.pp.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080624210420.GA43007@nagual.pp.ru> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: Subject: Re: CFT: BSD-licensed grep [Fwd: cvs commit: ports/textproc/bsdgrep Makefile distinfo] 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: Tue, 24 Jun 2008 21:30:22 -0000 On Wed, Jun 25, 2008 at 01:04:20AM +0400, Andrey Chernov wrote: > > if ((s = mbstowcs(NULL, f->base, 0)) == -1) > > return (0); > > The same here. Check EILSEQ and return 1 BTW, do you realyze that this code malloc()s _whole_file_ into memory (which not fits for very big files)? Non-localized old code use mmap, so don't actually malloc() it. Doe to that perhaps whole mmfile.c should be not used and removed. -- http://ache.pp.ru/