Mercurial > gnulib
changeset 37333:6553ec84b246
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>
author | Eric Blake <eblake@redhat.com> |
---|---|
date | Wed, 09 Apr 2014 10:20:08 -0600 |
parents | 157f433797f5 |
children | aebe95cc55d9 |
files | ChangeLog lib/fts.c |
diffstat | 2 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Wed Apr 09 09:08:55 2014 -0700 +++ b/ChangeLog Wed Apr 09 10:20:08 2014 -0600 @@ -1,3 +1,8 @@ +2014-04-09 Eric Blake <eblake@redhat.com> + + fts: avoid unnecessary strlen calls + * lib/fts.c (_D_EXACT_NAMLEN): Restore definition when needed. + 2014-04-09 Paul Eggert <eggert@cs.ucla.edu> fts: avoid unnecessary strlen calls
--- a/lib/fts.c Wed Apr 09 09:08:55 2014 -0700 +++ b/lib/fts.c Wed Apr 09 10:20:08 2014 -0600 @@ -79,6 +79,9 @@ #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. */