diff options
| author | Ophestra Umiker <cat@ophivana.moe> | 2024-10-25 12:14:57 +0900 |
|---|---|---|
| committer | Ophestra Umiker <cat@ophivana.moe> | 2024-10-25 12:14:57 +0900 |
| commit | 3b82cc55dea66c9c404c73b010203fd6a2c38cdb (patch) | |
| tree | 6446be6184408d627ae41ca2b63b07394527bf44 | |
| parent | 6bc5be7e5a2334274adf2945ad6d29d063a7086b (diff) | |
internal: use fallback paths when XDG_RUNTIME_DIR is not absolute
There are scenarios where XDG_RUNTIME_DIR is set to an empty string or garbage. This check tries to ensure reasonable behaviour in most of those cases.
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
| -rw-r--r-- | internal/system.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/system.go b/internal/system.go index 6467ea05..5f5e76bc 100644 --- a/internal/system.go +++ b/internal/system.go @@ -55,7 +55,7 @@ func CopyPaths(os System, v *Paths) { fmsg.VPrintf("process share directory at %q", v.SharePath) - if r, ok := os.LookupEnv(xdgRuntimeDir); !ok { + if r, ok := os.LookupEnv(xdgRuntimeDir); !ok || r == "" || !path.IsAbs(r) { // fall back to path in share since fortify has no hard XDG dependency v.RunDirPath = path.Join(v.SharePath, "run") v.RuntimePath = path.Join(v.RunDirPath, "compat") |
