]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/app.cpp
fixed MSVC6 compiler warning
[wxWidgets.git] / src / mac / carbon / app.cpp
index 83406b962384de5bb166d0d55b15fa957c29f396..9e29f7961c8359ff1204b354f7afb30000c48879 100644 (file)
@@ -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