Subject: Re: bug#12958: Assume POSIX 1003.1-1988 or later for dirent.h.

From: Eli Zaretskii <[email-masked]>
Date: Thu, 22 Nov 2012 19:19:49 +0200

> Date: Wed, 21 Nov 2012 20:16:23 -0800
> From: Paul Eggert <[email-masked]>
> 
> Here's a patch that I'd like to install to simplify Emacs based
> on assuming that the underyling system supports POSIX 1003.1-1988
> or later with respect to dirent.h.  This is universal these days
> on GNUish hosts.  I'm CC'ing this to Eli, as this affects the
> Microsoft port, by updating it a bit to use the POSIXish
> "struct dirent" rather than the pre-POSIX "struct direct".
> I have tested this on GNU/Linux but not on Microsoft.

This is OK, but this part:

> +/* Return true if DP represents a real directory entry.  */
> +static bool
> +dirent_nonempty (struct dirent *dp)
> +{
> +#ifdef MSDOS
> +  return dp->d_name[0] != 0;
> +#else
> +  return 1;
> +#endif
> +}

is not needed at all.  The reason there was an MSDOS specific
definition of DIRENT_NONEMPTY macro is that the Posix definition used
d_ino, which the MSDOS implementation doesn't provide.  But if that
member is not used, we can toss this macro and assume that every entry
is "real".

Otherwise, I see no problems with this patch.

Thanks.