From 0c6e8a8123c9f74db757272f73adcbd8621e012d Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Sun, 6 Dec 2020 21:11:43 +0100 Subject: Codechange: Store file search paths as std::string. --- src/video/cocoa/cocoa_v.mm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/video/cocoa') diff --git a/src/video/cocoa/cocoa_v.mm b/src/video/cocoa/cocoa_v.mm index 10f30027b..f02599799 100644 --- a/src/video/cocoa/cocoa_v.mm +++ b/src/video/cocoa/cocoa_v.mm @@ -34,6 +34,7 @@ #include "../../window_func.h" #include "../../window_gui.h" +#include #import /* for MAXPATHLEN */ /** @@ -545,13 +546,15 @@ void CocoaDialog(const char *title, const char *message, const char *buttonLabel */ void cocoaSetApplicationBundleDir() { + extern std::array _searchpaths; + char tmp[MAXPATHLEN]; CFAutoRelease url(CFBundleCopyResourcesDirectoryURL(CFBundleGetMainBundle())); if (CFURLGetFileSystemRepresentation(url.get(), true, (unsigned char*)tmp, MAXPATHLEN)) { AppendPathSeparator(tmp, lastof(tmp)); - _searchpaths[SP_APPLICATION_BUNDLE_DIR] = stredup(tmp); + _searchpaths[SP_APPLICATION_BUNDLE_DIR] = tmp; } else { - _searchpaths[SP_APPLICATION_BUNDLE_DIR] = NULL; + _searchpaths[SP_APPLICATION_BUNDLE_DIR].clear(); } } -- cgit v1.2.3-70-g09d2