mirror of
https://github.com/transmission/transmission
synced 2024-12-24 08:43:27 +00:00
#4422 On Mac, tr_getWebClientDir() uses incorrect encoding for creating the web content dir path
This commit is contained in:
parent
177f2398a5
commit
fbfae34837
1 changed files with 3 additions and 7 deletions
|
@ -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 );
|
||||
|
|
Loading…
Reference in a new issue