mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-28 13:53:10 +00: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:
parent
58245b6fe7
commit
181ce4a6b6
1 changed files with 1 additions and 2 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue