This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] glob: Avoid copying the d_name field of struct dirent [BZ #19779]
- From: Roland McGrath <roland at hack dot frob dot com>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Mon, 2 May 2016 15:48:24 -0700 (PDT)
- Subject: Re: [PATCH] glob: Avoid copying the d_name field of struct dirent [BZ #19779]
- Authentication-results: sourceware.org; auth=none
- References: <56E339A7 dot 7060704 at redhat dot com> <20160311222757 dot DB90C2C3C24 at topped-with-meat dot com> <56FBBA94 dot 1040605 at redhat dot com> <20160330232737 dot 2A3F32C3C35 at topped-with-meat dot com> <56FD5B69 dot 1010002 at redhat dot com> <20160401215549 dot E32FC2C3BCD at topped-with-meat dot com> <57233290 dot 8090900 at redhat dot com>
Pretty much OK.
Please follow up quickly on making sure we are harmonized with gnulib.
> +# if defined _DIRENT_HAVE_D_TYPE || defined HAVE_STRUCT_DIRENT_D_TYPE
> + unsigned char type;
> +# endif
uint8_t seems better for something that is not a character.
> + struct readdir_result result = {NULL};
Put spaces around NULL, or just use {} (which has the same semantics).
> +#ifndef COMPILE_GLOB64
Ditto in the copy. Ick for having a copy. If it seems best to have a
copy, then at least put a comment on the copy saying it needs to match.