From: Eric Blake Date: Wed, 9 Apr 2014 16:20:08 +0000 (-0600) Subject: fts: avoid unnecessary strlen calls X-Git-Tag: v1.0~7405 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=f4eba3ef124442a0e8c60cf70ca7d9962a1540a8;p=gnulib.git fts: avoid unnecessary strlen calls Not all platforms have _D_EXACT_NAMLEN. * lib/fts.c (_D_EXACT_NAMLEN): Restore definition when needed. Signed-off-by: Eric Blake --- diff --git a/ChangeLog b/ChangeLog index fb2f7a1e4a..381b269b0b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-04-09 Eric Blake + + fts: avoid unnecessary strlen calls + * lib/fts.c (_D_EXACT_NAMLEN): Restore definition when needed. + 2014-04-09 Paul Eggert fts: avoid unnecessary strlen calls diff --git a/lib/fts.c b/lib/fts.c index 992bbad777..500e92c6b8 100644 --- a/lib/fts.c +++ b/lib/fts.c @@ -79,6 +79,9 @@ static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94"; #endif #include +#ifndef _D_EXACT_NAMLEN +# define _D_EXACT_NAMLEN(dirent) strlen ((dirent)->d_name) +#endif #if HAVE_STRUCT_DIRENT_D_TYPE /* True if the type of the directory entry D is known. */