Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 May 2002 07:23:09 -0400
From:      Chris Faulhaber <jedgar@fxp.org>
To:        Giorgos Keramidas <keramida@FreeBSD.org>
Cc:        freebsd-audit@FreeBSD.org
Subject:   Re: RFC: Port of NetBSD cat(1)'s -f option.
Message-ID:  <20020515112309.GA53228@darkstar.doublethink.cx>
In-Reply-To: <20020515061827.GA47688@hades.hell.gr>
References:  <20020515061827.GA47688@hades.hell.gr>

next in thread | previous in thread | raw e-mail | index | archive | help

--FCuugMFkClbJLl1L
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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:
>=20
>  		} else {
> +			struct stat st;
> +
>  			filename =3D path;
> +			if (stat(path, &st) < 0 ||
> +			    S_ISREG(st.st_mode) =3D=3D 0) {
> +				i++;		/* Skip to next file. */
> +				continue;
> +			}
> +

You might not want to declare 'st' with such a local scope; otherwise
looks ok here.

--=20
Chris D. Faulhaber - jedgar@fxp.org - jedgar@FreeBSD.org
--------------------------------------------------------
FreeBSD: The Power To Serve   -   http://www.FreeBSD.org

--FCuugMFkClbJLl1L
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (FreeBSD)
Comment: FreeBSD: The Power To Serve

iEYEARECAAYFAjziRR0ACgkQObaG4P6BelCi8ACdGJ2J6Mas0OeBtfns/Kd46FI8
oH4AmwcIA+ka1+Bb0rWkeQGIxfOixruk
=WD3t
-----END PGP SIGNATURE-----

--FCuugMFkClbJLl1L--

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




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