From a2cffa18c952f435607fe0397d5258fa61d3da99 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Tue, 20 Jul 2004 09:19:22 +0000 Subject: [PATCH] corrected cwd manipulation for unicode builds git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28320 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/app.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/mac/carbon/app.cpp b/src/mac/carbon/app.cpp index 83406b9623..9e29f7961c 100644 --- a/src/mac/carbon/app.cpp +++ b/src/mac/carbon/app.cpp @@ -635,18 +635,12 @@ bool wxApp::Initialize(int& argc, wxChar **argv) wxString startupCwd = wxGetCwd() ; if ( startupCwd == wxT("/") || startupCwd.Right(15) == wxT("/Contents/MacOS") ) { - wxString cwd ; CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle() ) ; CFURLRef urlParent = CFURLCreateCopyDeletingLastPathComponent( kCFAllocatorDefault , url ) ; CFRelease( url ) ; CFStringRef path = CFURLCopyFileSystemPath ( urlParent , kCFURLPOSIXPathStyle ) ; CFRelease( urlParent ) ; - CFIndex len = CFStringGetLength( path ) ; - CFIndex max = CFStringGetMaximumSizeForEncoding( len, kCFStringEncodingUTF8 ) ; - wxChar* buf = cwd.GetWriteBuf( max ) ; - CFStringGetCString( path , buf , max + 1 , kCFStringEncodingUTF8 ) ; - CFRelease( path ) ; - cwd.UngetWriteBuf() ; + wxString cwd = wxMacCFStringHolder(path).AsString(wxLocale::GetSystemEncoding()); wxSetWorkingDirectory( cwd ) ; } #endif -- 2.45.2