[PATCH] Fix cache dir resolving on Windows

Eli Zaretskii eliz@gnu.org
Fri Jun 7 07:36:00 GMT 2019


> From: orgads@gmail.com
> Cc: Orgad Shaneh <orgads@gmail.com>
> Date: Fri,  7 Jun 2019 09:27:19 +0300
> 
> From: Orgad Shaneh <orgads@gmail.com>
> 
> ... when not running from MSYS environment, and HOME is not set.
> ---
>  gdb/common/pathstuff.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/gdb/common/pathstuff.c b/gdb/common/pathstuff.c
> index 2b1669a5b9..59410fb61f 100644
> --- a/gdb/common/pathstuff.c
> +++ b/gdb/common/pathstuff.c
> @@ -231,6 +231,10 @@ get_standard_cache_dir ()
>  #endif
>  
>    const char *home = getenv ("HOME");
> +#ifdef _WIN32
> +  if (home == nullptr)
> +      home = getenv ("APPDATA");
> +#endif
>    if (home != NULL)
>      {
>        /* Make sure the path is absolute and tilde-expanded.  */

Thanks, this LGTM.



More information about the Gdb-patches mailing list