]> git.mxchange.org Git - flightgear.git/commitdiff
Fix Mac data dir finding.
authorJames Turner <zakalawe@mac.com>
Mon, 26 Aug 2013 21:21:55 +0000 (22:21 +0100)
committerJames Turner <zakalawe@mac.com>
Mon, 26 Aug 2013 21:21:55 +0000 (22:21 +0100)
Mostly affects release builds, ensure data dir located within
the bundle is found correctly.

src/Main/options.cxx

index 70a48decc3184b6f3b66b1f4ddf13e66b90da255..ac594216259f656f13982b96d43af6228c9d2fe6 100644 (file)
@@ -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);