mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 11:28:22 +00:00
fix(stdpath): default to /tmp if stdpath('run') cannot be created #20952
Fix #20949
This commit is contained in:
@@ -87,6 +87,9 @@ char *stdpaths_get_xdg_var(const XDGVarType idx)
|
|||||||
} else if (idx == kXDGRuntimeDir) {
|
} else if (idx == kXDGRuntimeDir) {
|
||||||
// Special-case: stdpath('run') is defined at startup.
|
// Special-case: stdpath('run') is defined at startup.
|
||||||
ret = vim_gettempdir();
|
ret = vim_gettempdir();
|
||||||
|
if (ret == NULL) {
|
||||||
|
ret = "/tmp/";
|
||||||
|
}
|
||||||
size_t len = strlen(ret);
|
size_t len = strlen(ret);
|
||||||
ret = xstrndup(ret, len >= 2 ? len - 1 : 0); // Trim trailing slash.
|
ret = xstrndup(ret, len >= 2 ? len - 1 : 0); // Trim trailing slash.
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user