Re: [PATCH] gdb: check for empty strings in get_standard_cache_dir/get_standard_config_dir

Lancelot SIX via Gdb-patches
2021-01-07T21:43:44Z

Hi
> Ok, I can try this as a follow-up patch, check that the path
> is absolute using the IS_ABSOLUTE_PATH macro. Is a tilde path
> considered absolute? Like
>
> ~/my-cache
> ~smarchi/my-cache
I would be tempted to say that it is not (according to
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html
it seems it is not).
> I suppose that it is, since it's just a shortcut for
> /home/smarchi.

This actually is the most usual pattern, but the home directory of
smarchi could be different. The actual answer is in /etc/passwd or
accessed via getent:

$ getent passwd smarchi | awk -F: '{ print $6 }'

>
> Simon
Lancelot.