Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Jul 1999 08:17:58 -0400 (EDT)
From:      Jamie Howard <howardjp@wam.umd.edu>
To:        "Nickolay N. Dudorov" <nnd@news.itfs.nsk.su>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: replacing grep(1)
Message-ID:  <Pine.LNX.4.10.9907270808400.1443-100000@dragon.ham.muohio.edu>
In-Reply-To: <199907271239.TAA36462@news.itfs.nsk.su>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 27 Jul 1999, Nickolay N. Dudorov wrote:

> 	After making it on the CURRENT system I can only
> see:
> 
> 	grep: filename: Undefined error: 0
> 
> for every filename.

Every file?

> 
> 	This caused by very "unusual" return values for
> 'grep_open' (and other '..._open') function which is declared
> as 'int' (and return int result) and compared with NULL ;-(
> 
> 	I prefer not to include the patch for this because
> I am uncompatible with such trics as:
> 
> 	return ((f = fopen(path, mode)) != NULL) - 1;

This was done this way because the gzopen and fopen both return pointers
of different types.  Maybe the best thing would be to have grep_open()
return a void pointer since procfile() doesn't keep track of what files
are open and not.  This is ugly and not very reusable, but then again how
many programs need transparent access to both gzip'd and plaintext files?

Jamie



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.10.9907270808400.1443-100000>