zig/lib/std/fs
Ian Johnson 0a70455095 Fix handling of empty XDG environment variables
Closes #21132

According to the XDG Base Directory specification
(https://specifications.freedesktop.org/basedir-spec/latest/#variables),
empty values for these environment variables should be treated the same
as if they are unset. Specifically, for the instances changed in this
commit,

> $XDG_DATA_HOME defines the base directory relative to which
> user-specific data files should be stored. If $XDG_DATA_HOME is either
> not set **or empty**, a default equal to $HOME/.local/share should be
> used.

and

> $XDG_CACHE_HOME defines the base directory relative to which
> user-specific non-essential data files should be stored. If
> $XDG_CACHE_HOME is either not set **or empty**, a default equal to
> $HOME/.cache should be used.

(emphasis mine)

In addition to the case mentioned in the linked issue, all other uses of
XDG environment variables were corrected.
2024-08-19 23:30:14 -07:00
..
AtomicFile.zig extract std.posix from std.os 2024-03-19 11:45:09 -07:00
Dir.zig add std.fs.Dir.Handle 2024-08-01 13:47:23 -07:00
File.zig std.fs: Rework to always use statx() instead of fstat()/fstatat() on Linux. 2024-07-29 09:50:41 +02:00
get_app_data_dir.zig Fix handling of empty XDG environment variables 2024-08-19 23:30:14 -07:00
path.zig std: promote tests to doctests 2024-03-21 14:11:46 -07:00
test.zig Rename MAX_NAME_BYTES to max_name_bytes 2024-07-03 17:42:09 +01:00
wasi.zig fix compilation failures found by CI 2024-03-19 16:18:18 -07:00