Fix when fish isn't already installed

This was still wrong.
This commit is contained in:
Aaron Gyes 2016-07-01 04:34:04 -07:00
parent af0f9e5308
commit 3d8e8a8715

View file

@ -126,14 +126,14 @@ static struct config_paths_t determine_config_directory_paths(const char *argv0)
// link CF, use this lame approach to test it: see if the resolved path ends with
// /Contents/MacOS/fish, case insensitive since HFS+ usually is.
if (!done) {
const char *suffix = "/Contents/Resources/base/bin/fish";
const char *suffix = "Contents/Resources/base/bin/fish";
const size_t suffixlen = strlen(suffix);
if (has_suffix(exec_path, suffix, true)) {
// Looks like we're a bundle. Cut the string at the / prefixing /Contents... and
// then the rest.
wcstring wide_resolved_path = str2wcstring(exec_path);
wide_resolved_path.resize(exec_path.size() - suffixlen);
wide_resolved_path.append(L"/Contents/Resources/");
wide_resolved_path.append(L"Contents/Resources/base/");
// Append share, etc, doc.
paths.data = wide_resolved_path + L"share/fish";