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

Tom Tromey tom@tromey.com
Thu Jan 7 21:00:30 GMT 2021


>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:

Simon> gdb_abspath doesn't handle empty strings, so handle this case in the
Simon> callers.  If a variable is defined but empty, I think it's reasonable in
Simon> this case to just ignore it, as if it was not defined.

Makes sense to me.

For XDG, I read here:

    https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

this:

    All paths set in these environment variables must be absolute. If an
    implementation encounters a relative path in any of these variables it
    should consider the path invalid and ignore it.

So I suppose we could go a bit further here.

Tom


More information about the Gdb-patches mailing list