]> granicus.if.org Git - transmission/commitdiff
#1210 on Mac, the web ui should now work when Transmission's path contains a space
authorMitchell Livingston <livings124@transmissionbt.com>
Fri, 22 Aug 2008 23:55:33 +0000 (23:55 +0000)
committerMitchell Livingston <livings124@transmissionbt.com>
Fri, 22 Aug 2008 23:55:33 +0000 (23:55 +0000)
libtransmission/platform.c

index 53f98a56c1b3bf83e5abd395320d242b14cd58b3..ce6e66c37910b739ff39b6eb97ebfb92f8857000 100644 (file)
@@ -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