GNU bug report logs -
#12958
Assume POSIX 1003.1-1988 or later for dirent.h.
Previous Next
Reported by: Paul Eggert <eggert <at> cs.ucla.edu>
Date: Thu, 22 Nov 2012 04:18:02 UTC
Severity: normal
Tags: patch
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> Date: Wed, 21 Nov 2012 20:16:23 -0800
> From: Paul Eggert <eggert <at> cs.ucla.edu>
>
> 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.
This bug report was last modified 12 years and 183 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.