Since applying strlen to the name always works, we'll just do that. */
#define NAMLEN(p) strlen (p->d_name)
-#define DIRENTRY_NONEMPTY(p) ((p)->d_ino)
+#ifdef __CYGWIN__
+# define DIRENTRY_NONEMPTY(p) ((p)->d_name[0] != '\0')
+#else
+# define DIRENTRY_NONEMPTY(p) ((p)->d_ino)
+#endif
/* encapsulation: directory calls */