diff options
| author | Antonin Décimo <antonin.decimo@gmail.com> | 2022-03-11 14:08:49 +0100 |
|---|---|---|
| committer | Simon Ser <contact@emersion.fr> | 2022-06-09 18:34:17 +0000 |
| commit | 9434e8d69f76d7859ed7b18edc5a62450ad8d040 (patch) | |
| tree | 8f5bc37e37479183bc2da284a7444a3b7ac68f8c /tests/socket-test.c | |
| parent | cursor/os-compatibility: fix trailing space (diff) | |
| download | wayland-9434e8d69f76d7859ed7b18edc5a62450ad8d040.tar wayland-9434e8d69f76d7859ed7b18edc5a62450ad8d040.tar.gz wayland-9434e8d69f76d7859ed7b18edc5a62450ad8d040.tar.bz2 wayland-9434e8d69f76d7859ed7b18edc5a62450ad8d040.tar.lz wayland-9434e8d69f76d7859ed7b18edc5a62450ad8d040.tar.xz wayland-9434e8d69f76d7859ed7b18edc5a62450ad8d040.tar.zst wayland-9434e8d69f76d7859ed7b18edc5a62450ad8d040.zip | |
Check that XDG base directories paths are absolute
The [spec][1] reads:
> 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.
and
> If $XDG_DATA_HOME is either not set or empty, a default equal to
> $HOME/.local/share should be used.
Testing that the path is absolute also entails that is is non-empty.
[1]: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
Signed-off-by: Antonin Décimo <antonin.decimo@gmail.com>
Diffstat (limited to 'tests/socket-test.c')
| -rw-r--r-- | tests/socket-test.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/socket-test.c b/tests/socket-test.c index 8d39edc..78743dc 100644 --- a/tests/socket-test.c +++ b/tests/socket-test.c @@ -51,7 +51,7 @@ static const char * require_xdg_runtime_dir(void) { char *val = getenv("XDG_RUNTIME_DIR"); - assert(val && "set $XDG_RUNTIME_DIR to run this test"); + assert(val && val[0] == '/' && "set $XDG_RUNTIME_DIR to run this test"); return val; } |
