From: James Turner Date: Mon, 26 Aug 2013 21:21:55 +0000 (+0100) Subject: Fix Mac data dir finding. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4052c45ea3ce8a6a3833aee20e1629f9db2e400c;p=flightgear.git Fix Mac data dir finding. Mostly affects release builds, ensure data dir located within the bundle is found correctly. --- diff --git a/src/Main/options.cxx b/src/Main/options.cxx index 70a48decc..ac5942162 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -2233,10 +2233,13 @@ string Options::platformDefaultRoot() const // look for a 'data' subdir CFURLRef dataDir = CFURLCreateCopyAppendingPathComponent(NULL, resourcesUrl, CFSTR("data"), true); + CFURLRef absoluteDataUrl = CFURLCopyAbsoluteURL(dataDir); + // now convert down to a path, and the a c-string - CFStringRef path = CFURLCopyFileSystemPath(dataDir, kCFURLPOSIXPathStyle); + CFStringRef path = CFURLCopyFileSystemPath(absoluteDataUrl, kCFURLPOSIXPathStyle); string root = CFStringGetCStringPtr(path, CFStringGetSystemEncoding()); + CFRelease(absoluteDataUrl); CFRelease(resourcesUrl); CFRelease(dataDir); CFRelease(path);