Programmers always want to make things "cooler". Just leave the ->d_namlen there :)
On Sun, Jul 3, 2011 at 2:49 PM, Ed Schouten <[email protected]> wrote: > * Robert Millan <[email protected]>, 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 <[email protected]> > WWW: http://80386.nl/ > -- Zhihao Yuan, nickname lichray The best way to predict the future is to invent it. ___________________________________________________ 4BSD -- http://4bsd.biz/ _______________________________________________ [email protected] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[email protected]"

