From e2a3dae58b265121f192bf6518ff2f7969378aeb Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sat, 21 Jul 2018 16:40:23 -0700 Subject: [PATCH] Don't require ./etc to exist in relocatable fish fish tries to be relocatable by looking for directories relative to its executable. These directories are not found when running fish from within a cmake build because the etc directory is not present. Stop requiring this directory to be present since it's not critical for running fish. Fixes #4825 --- src/fish.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/fish.cpp b/src/fish.cpp index baeab0dd0..6ad5de493 100644 --- a/src/fish.cpp +++ b/src/fish.cpp @@ -156,12 +156,11 @@ static struct config_paths_t determine_config_directory_paths(const char *argv0) paths.doc = base_path + (seems_installed ? L"/share/doc/fish" : L"/user_doc/html"); paths.bin = base_path + (seems_installed ? L"/bin" : L""); - // Check only that the data and sysconf directories exist. Handle the doc - // directories separately. - struct stat buf; - if (0 == wstat(paths.data, &buf) && 0 == wstat(paths.sysconf, &buf)) { + // Check only that the data directories exist. Allow the sysconf dir to be invalid. + // Handle the doc directories separately. + if (0 == waccess(paths.data, R_OK)) { // The docs dir may not exist; in that case fall back to the compiled in path. - if (0 != wstat(paths.doc, &buf)) { + if (0 == waccess(paths.doc, R_OK)) { paths.doc = L"" DOCDIR; } done = true;