Bug#264887: GLOB_APPEND ignored by glob() in at least one place
On Tue, 2004-08-10 at 14:41 -0500, Jeff Licquia wrote:
> When the GLOB_APPEND flag is passed to glob(), the call is supposed to
> tack new results on to the ones already represented in the glob_t passed
> in. If there is an error, partial results may be added, but the
> original glob_t should definitely be left alone.
>
> This is not respected in at least one part of glibc's glob
> implementation. In this particular place, globfree() is called on the
> glob_t regardless of the flags passed. Since glob() is implemented
> recursively with GLOB_APPEND added to the flags, this can affect the
> results returned even from a call where GLOB_APPEND is not set.
>
> The following patch fixes the one instance of this behavior I found.
Thanks for the patch. Do you have a testcase that demonstrates the
effect of the bug?
p.
Reply to: