[PATCH] glob: Avoid copying the d_name field of struct dirent [BZ #19779]
Paul Eggert
eggert@cs.ucla.edu
Wed May 4 17:40:00 GMT 2016
I merged those changes into gnulib's glob.c here:
http://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=36cc6c33ade715a844662cefd256f8f8fdd8a05d
Gnulib still differs from glibc glob.c in that (a) Gnulib uses spaces
and not tabs, (b) Gnulib's comments quote 'like this' and not `like
this', and (c) Gnulib contains several other portability changes briefly
described below and detailed in the attached patch. The first bullet is
probably worth a more-detailed look in glibc; the other stuff doesn't
appear to be urgent.
* glibc glob.c has an assignment 'name = alloca_account (buflen,
alloca_used)' that is not guarded by __libc_use_alloca.
* glibc glob.c is missing some Gnulib-only portability hacks, protected
inside "#ifndef _LIBC", "#ifndef __attribute_noinline__", etc.
* glibc glob.c has some now-unnecessary "#if _LIBC"s that can be omitted
to simplify the code.
* glibc glob.c has some unnecessary casts, e.g., the cast in 'char *new
= (char *) malloc (dirlen + 1 + eltlen);'.
* A glibc glob.c comment says that something is "illegal" where it is
merely invalid. (This is a pet peeve of RMS's.)
* glibc glob.c assumes C99 statements-before-decls in a couple of places.
* glibc glob.c has a complicated cast '*(const char *const * const) a'
that confuses some compilers.
* There is some complicated stuff in the link_exists2_p area that
doesn't port well to platforms with fstatat.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: glob.diff
Type: text/x-patch
Size: 18287 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20160504/68d8bca4/attachment.bin>
More information about the Libc-alpha
mailing list