Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Jul 2011 21:49:08 +0200
From:      Ed Schouten <ed@80386.nl>
To:        Robert Millan <rmh@debian.org>
Cc:        freebsd-hackers@freebsd.org, Ed Maste <emaste@freebsd.org>
Subject:   Re: [PATCH] build config(8) on GNU systems
Message-ID:  <20110703194908.GO71453@hoeg.nl>
In-Reply-To: <CAOfDtXP-vZ=qDKZuw0P7=NwX5BfUpqqvGsLLrVHTjrnaRjcMhQ@mail.gmail.com>
References:  <CAOfDtXP-vZ=qDKZuw0P7=NwX5BfUpqqvGsLLrVHTjrnaRjcMhQ@mail.gmail.com>

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

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

* Robert Millan <rmh@debian.org>, 20110702 16:56:
> Index: usr.sbin/config/main.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> --- usr.sbin/config/main.c	(revision 223721)
> +++ usr.sbin/config/main.c	(working copy)
> @@ -591,7 +591,11 @@
>  	if ((dirp =3D opendir(p)) =3D=3D NULL)
>  		err(EX_OSERR, "opendir %s", p);
>  	while ((dp =3D readdir(dirp)) !=3D NULL) {
> +#ifdef _DIRENT_HAVE_D_NAMLEN
>  		i =3D dp->d_namlen - 2;
> +#else
> +		i =3D strlen (dp->d_name) - 2;
> +#endif
>  		/* Skip non-headers */
>  		if (dp->d_name[i] !=3D '.' || dp->d_name[i + 1] !=3D 'h')
>  			continue;

Why not simply use strlen() unconditionally?

--=20
 Ed Schouten <ed@80386.nl>
 WWW: http://80386.nl/

--Wfe1KbQWcwuymTys
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (FreeBSD)

iQIcBAEBAgAGBQJOEMe0AAoJEG5e2P40kaK7/TcQAKpsL4NeUhq6SAOiK0Zxr+tB
MYBSiu1QMo3+JtXFCKCecEqHPpoXew6o2+daktYxFgpxf2eopLdvXLa88Dh6kJT4
DfpTpUam5runU5U8f3HhLM2liwkHgmRkI6yJGUQAgZVdHriF1lMeNqi6ILI+Tv0U
23t6hJc6GCwz/JG2hKNS/iEyjdHj+JoZqU4VtxMBHIHXaj5aUxQDW1+VK2eSz9s/
XAZbvcZMVMF+ZjcBuYVJs/odYez1pnZxk/xDjmhlCvWOjoO3X7N+4BEyBeaC6jti
NfL/bWjctynpP3e6eFYbTGDFnRA0VaA2gRsUYKaJkLTJN6Fsd/+NcmVMk2+77LmQ
MW2bwz6i6VbVBKRB0ETHkukl7XuHQLrlADzBJTBDjXwZKEIte2qSlnMJ7BOZe5nU
5Rzd/uvr9p7z/wdVUmrVgTj2s+rx4WCffe3OV7HDsOTOaFaXITa6WrSay5RNY1TM
Y/5nIwxHcKLffUt/RktBNaWx6XBBt/2RCYoxVKtOclA+YMEABf0W8Pj1DcKtcGxu
QdhfhIj+F5fq3KEC/6FwTgFUfPuInLbkN2zoiXM5t991QOe2rTCvjgsF9cL8kxGJ
PjPXT1fRKzTOrQigKhPiW4EBNNlmXykxmoO6IWbBhXHRTU1h7dIE74KvERR+rBm1
C4bx9FZh2pEPJgC05cNM
=Mj3D
-----END PGP SIGNATURE-----

--Wfe1KbQWcwuymTys--



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