changeset 38767:471163f4866b

glob: fix typo that broke platforms lacking d_ino This typo also hurt performance on GNU/Linux and similar hosts. * lib/glob.c (D_INO_TO_RESULT): Fix typo (reversed ifdef) in previous change.
author Paul Eggert <eggert@cs.ucla.edu>
date Thu, 24 Aug 2017 00:46:49 -0700
parents 8503625f3afb
children 5ee2bbc9aae1
files ChangeLog lib/glob.c
diffstat 2 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Aug 23 14:45:58 2017 -0700
+++ b/ChangeLog	Thu Aug 24 00:46:49 2017 -0700
@@ -1,3 +1,10 @@
+2017-08-24  Paul Eggert  <eggert@cs.ucla.edu>
+
+	glob: fix typo that broke platforms lacking d_ino
+	This typo also hurt performance on GNU/Linux and similar hosts.
+	* lib/glob.c (D_INO_TO_RESULT): Fix typo (reversed ifdef)
+	in previous change.
+
 2017-08-23  Paul Eggert  <eggert@cs.ucla.edu>
 
 	glob: merge from glibc with Zanella glob changes
--- a/lib/glob.c	Wed Aug 23 14:45:58 2017 -0700
+++ b/lib/glob.c	Thu Aug 24 00:46:49 2017 -0700
@@ -141,12 +141,12 @@
 
 #endif /* defined _DIRENT_HAVE_D_TYPE || defined HAVE_STRUCT_DIRENT_D_TYPE */
 
-#if defined _LIBC || defined D_INO_IN_DIRENT
 /* Initializer for skip_entry.  POSIX does not require that the d_ino
    field be present, and some systems do not provide it. */
-# define D_INO_TO_RESULT(source) false,
+#if defined _LIBC || defined D_INO_IN_DIRENT
+# define D_INO_TO_RESULT(source) (source)->d_ino == 0,
 #else
-# define D_INO_TO_RESULT(source) (source)->d_ino == 0,
+# define D_INO_TO_RESULT(source) false,
 #endif
 
 /* Construct an initializer for a struct readdir_result object from a