From b758c0c335ad9d504d7a76baa5a331e9abf0ede5 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Fri, 17 Jan 2014 14:18:45 -0800 Subject: [PATCH] Relax the requirement that we find a working 'doc' directory in order for fish to be relocatable. Instead we only look for data and configuration path --- fish.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/fish.cpp b/fish.cpp index 57d268d72..77686195a 100644 --- a/fish.cpp +++ b/fish.cpp @@ -187,11 +187,16 @@ static struct config_paths_t determine_config_directory_paths(const char *argv0) paths.sysconf = base_path + L"/etc/fish"; paths.doc = base_path + L"/share/doc/fish"; paths.bin = base_path + L"/bin"; - + + /* 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) && - 0 == wstat(paths.doc, &buf)) + if (0 == wstat(paths.data, &buf) && 0 == wstat(paths.sysconf, &buf)) { + /* The docs dir may not exist; in that case fall back to the compiled in path */ + if (0 != wstat(paths.doc, &buf)) + { + paths.doc = L"" DOCDIR; + } done = true; } }