#4422 On Mac, tr_getWebClientDir() uses incorrect encoding for creating the web content dir path

This commit is contained in:
Mitchell Livingston 2011-08-15 00:10:06 +00:00
parent 177f2398a5
commit fbfae34837
1 changed files with 3 additions and 7 deletions

View File

@ -571,14 +571,10 @@ tr_getWebClientDir( const tr_session * session UNUSED )
CFURLRef appURL = CFBundleCopyBundleURL( CFBundleGetMainBundle( ) );
CFStringRef appRef = CFURLCopyFileSystemPath( appURL,
kCFURLPOSIXPathStyle );
CFIndex appLength = CFStringGetMaximumSizeForEncoding( CFStringGetLength(appRef),
CFStringGetFastestEncoding( appRef ));
const CFIndex appStringLength = CFStringGetMaximumSizeOfFileSystemRepresentation(appRef);
char * appString = tr_malloc( appLength + 1 );
bool success = CFStringGetCString( appRef,
appString,
appLength + 1,
CFStringGetFastestEncoding( appRef ));
char * appString = tr_malloc( appStringLength );
const bool success = CFStringGetFileSystemRepresentation( appRef, appString, appStringLength );
assert( success );
CFRelease( appURL );