internal: use fallback paths when XDG_RUNTIME_DIR is not absolute
test / test (push) Successful in 24s
Details
test / test (push) Successful in 24s
Details
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>
This commit is contained in:
parent
6bc5be7e5a
commit
3b82cc55de
|
@ -55,7 +55,7 @@ func CopyPaths(os System, v *Paths) {
|
||||||
|
|
||||||
fmsg.VPrintf("process share directory at %q", v.SharePath)
|
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
|
// fall back to path in share since fortify has no hard XDG dependency
|
||||||
v.RunDirPath = path.Join(v.SharePath, "run")
|
v.RunDirPath = path.Join(v.SharePath, "run")
|
||||||
v.RuntimePath = path.Join(v.RunDirPath, "compat")
|
v.RuntimePath = path.Join(v.RunDirPath, "compat")
|
||||||
|
|
Loading…
Reference in New Issue