Re: RFC: Port of NetBSD cat(1)'s -f option.
Chris Faulhaber <[email protected]>
| Newsgroups | gmane.os.freebsd.devel.audit |
|---|---|
| Message-ID | <[email protected]> |
On Wed, May 15, 2002 at 09:18:28AM +0300, Giorgos Keramidas wrote:
> Here's a patch that adds to our cat(1) the same functionality as
> NetBSD cat(1) when passed -f on the command line. The original
> commit log from NetBSD's CVS tree is:
>
> } else {
> + struct stat st;
> +
> filename = path;
> + if (stat(path, &st) < 0 ||
> + S_ISREG(st.st_mode) == 0) {
> + i++; /* Skip to next file. */
> + continue;
> + }
> +
You might not want to declare 'st' with such a local scope; otherwise
looks ok here.
--
Chris D. Faulhaber - [email protected] - [email protected]
--------------------------------------------------------
FreeBSD: The Power To Serve - http://www.FreeBSD.org
signature.asc
(application/pgp-signature, 232 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: FreeBSD: The Power To Serve iEYEARECAAYFAjziRR0ACgkQObaG4P6BelCi8ACdGJ2J6Mas0OeBtfns/Kd46FI8 oH4AmwcIA+ka1+Bb0rWkeQGIxfOixruk =WD3t -----END PGP SIGNATURE-----