summaryrefslogtreecommitdiff
path: root/lib/fts.c
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2014-04-09 10:20:08 -0600
committerEric Blake <eblake@redhat.com>2014-04-09 10:20:08 -0600
commitf4eba3ef124442a0e8c60cf70ca7d9962a1540a8 (patch)
tree9ed54db2e5a81cd2d1ff123fa6c3a402bb86cebe /lib/fts.c
parentdf86f1c3641eeb60d605ca9f38166d18397e86c0 (diff)
downloadgnulib-f4eba3ef124442a0e8c60cf70ca7d9962a1540a8.tar.gz
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 <eblake@redhat.com>
Diffstat (limited to 'lib/fts.c')
-rw-r--r--lib/fts.c3
1 files changed, 3 insertions, 0 deletions
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 <dirent.h>
+#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. */