mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-09 03:51:20 -03:00
Actually create runtime path if needed
This checked if the path was readable and only then tried creating it, which... isn't right. Fixes #7335.
This commit is contained in:
@@ -1421,8 +1421,7 @@ wcstring env_get_runtime_path() {
|
||||
|
||||
// Check that the path is actually usable. Technically this is guaranteed by the fdo spec but in
|
||||
// practice it is not always the case: see #1828 and #2222.
|
||||
int mode = R_OK | W_OK | X_OK;
|
||||
if (dir != nullptr && access(dir, mode) == 0 && check_runtime_path(dir) == 0) {
|
||||
if (dir != nullptr && check_runtime_path(dir) == 0) {
|
||||
result = str2wcstring(dir);
|
||||
} else {
|
||||
// Don't rely on $USER being set, as setup_user() has not yet been called.
|
||||
|
||||
Reference in New Issue
Block a user