From: Mitchell Livingston Date: Fri, 22 Aug 2008 23:55:33 +0000 (+0000) Subject: #1210 on Mac, the web ui should now work when Transmission's path contains a space X-Git-Tag: 1.40~413 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fa8ffca078a32e9a961461aa7e3ad4fb01423ade;p=transmission #1210 on Mac, the web ui should now work when Transmission's path contains a space --- diff --git a/libtransmission/platform.c b/libtransmission/platform.c index 53f98a56c..ce6e66c37 100644 --- a/libtransmission/platform.c +++ b/libtransmission/platform.c @@ -525,21 +525,13 @@ tr_getClutchDir( const tr_session * session UNUSED ) else { #ifdef SYS_DARWIN - CFURLRef appURL = CFBundleCopyBundleURL( CFBundleGetMainBundle() ); - CFStringRef appRef = CFURLCopyPath( appURL ); + CFStringRef appRef = CFURLCopyFileSystemPath( appURL, kCFURLPOSIXPathStyle ); const char * appString = CFStringGetCStringPtr( appRef, CFStringGetFastestEncoding( appRef ) ); - CFRelease(appURL); - CFRelease(appRef); - - /*CFURLRef resourcesDirURL = CFBundleCopyResourcesDirectoryURL( CFBundleGetMainBundle() ); - CFStringRef resourcesDirRef = CFURLCopyPath( resourcesDirURL ); - const char * resourcesDirString = CFStringGetCStringPtr( resourcesDirRef, CFStringGetFastestEncoding( resourcesDirRef ) ); - CFRelease(resourcesDirURL); - CFRelease(resourcesDirRef);*/ + CFRelease( appURL ); + CFRelease( appRef ); - sprintf( path, "%s%s", appString, "Contents/Resources/web" ); - + tr_buildPath( path, sizeof( path ), appString, "Contents", "Resources", "web", NULL ); #elif defined(WIN32) #warning hey win32 people is this good or is there a better implementation of the next four lines