[PATCH 2/6] posix: Move the glob home directory lookups out of __glob
Collin Funk
collin.funk1@gmail.com
Thu Aug 6 01:36:04 GMT 2026
Adhemerval Zanella <adhemerval.zanella@linaro.org> writes:
> Expanding "~" or "~user" needs a struct scratch_buffer to call
> getpwnam_r through, where thecoce might reserve extra stack in
I assume you meant "the code" here?
> +static char *
> +glob_current_home_dir (bool *nospace)
> +{
> + struct passwd *p;
> + struct passwd pwbuf;
> + struct scratch_buffer s;
> + char *result;
> + int err;
[...]
> + result = err == 0 ? glob_dup_pw_dir (p, nospace) : NULL;
> + scratch_buffer_free (&s);
> + return result;
> +}
A while ago in Gnulib we moved all the variable declarations to where
they are used C99 style, since that is what we prefer for readability.
It isn't a blocker, but I think it would be a nice change for glibc as
well, at least for new code like this.
That is a minor thing I noticed and I figured was worth mentioning. The
patch itself looks good though. I'll let you decide if you want to
change that. Either way:
Reviewed-by: Collin Funk <collin.funk1@gmail.com>
Collin
More information about the Libc-alpha
mailing list