Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Jun 2008 01:30:18 +0400
From:      Andrey Chernov <ache@nagual.pp.ru>
To:        Gabor Kovesdan <gabor@FreeBSD.org>, hackers@FreeBSD.org, current@FreeBSD.org
Subject:   Re: CFT: BSD-licensed grep [Fwd: cvs commit: ports/textproc/bsdgrep Makefile distinfo]
Message-ID:  <20080624213018.GA71334@nagual.pp.ru>
In-Reply-To: <20080624210420.GA43007@nagual.pp.ru>
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>

next in thread | previous in thread | raw e-mail | index | archive | help
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/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080624213018.GA71334>