[PATCH] build config(8) on GNU systems

Ed Schouten ed at 80386.nl
Sun Jul 3 19:49:10 UTC 2011


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

Why not simply use strlen() unconditionally?

-- 
 Ed Schouten <ed at 80386.nl>
 WWW: http://80386.nl/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 834 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20110703/a8a6cf2f/attachment.pgp


More information about the freebsd-hackers mailing list