Ticket #3072: Modifiable_web_dirv2.patch
File Modifiable_web_dirv2.patch, 2.3 KB (added by Waldorf, 12 years ago) |
---|
-
platform.c
544 544 else 545 545 { 546 546 547 #ifdef SYS_DARWIN /* on Mac, look in the app package first, then the Application Support folder (for daemon, etc) */ 547 #ifdef SYS_DARWIN /* on Mac, look in the Application Support folder first, then in the app bundle. */ 548 char * appString; 549 tr_bool success; 548 550 549 551 CFURLRef appURL = CFBundleCopyBundleURL( CFBundleGetMainBundle( ) ); 550 552 CFStringRef appRef = CFURLCopyFileSystemPath( appURL, 551 kCFURLPOSIXPathStyle ); 552 const char * appString = CFStringGetCStringPtr( appRef, 553 CFStringGetFastestEncoding( appRef ) ); 553 kCFURLPOSIXPathStyle ); 554 CFIndex appLength = CFStringGetMaximumSizeForEncoding( CFStringGetLength(appRef), 555 CFStringGetFastestEncoding( appRef )); 556 557 appString = tr_malloc( appLength + 1 ); 558 success = CFStringGetCString( appRef, 559 appString, 560 appLength + 1, 561 CFStringGetFastestEncoding( appRef )); 562 assert( success ); 563 554 564 CFRelease( appURL ); 555 565 CFRelease( appRef ); 556 566 557 s = tr_buildPath( appString, "Contents", "Resources", "web", NULL ); 567 /* Look in the Application Support folder */ 568 s = tr_buildPath( tr_sessionGetConfigDir( session ), "web", NULL ); 558 569 559 570 if( !isWebClientDir( s ) ) { 560 571 tr_free( s ); 561 572 562 /* Fallback to the Application Support folder*/563 s = tr_buildPath( tr_sessionGetConfigDir( session ), "web", NULL );573 /* Fallback to the app bundle */ 574 s = tr_buildPath( appString, "Contents", "Resources", "web", NULL ); 564 575 if( !isWebClientDir( s ) ) { 565 576 tr_free( s ); 566 577 s = NULL; 567 578 } 568 579 } 580 tr_free( appString ); 569 581 570 582 #elif defined( WIN32 ) 571 583