Get rid of some Win16 code from wxSetWorkingDirectory

This commit is contained in:
ARATA Mizuki
2016-02-17 23:46:52 +09:00
parent 381ab333b9
commit a2b5309f61

View File

@@ -1390,31 +1390,7 @@ bool wxSetWorkingDirectory(const wxString& d)
#if defined(__UNIX__) || defined(__WXMAC__)
success = (chdir(wxFNSTRINGCAST d.fn_str()) == 0);
#elif defined(__WINDOWS__)
#ifdef __WIN32__
success = (SetCurrentDirectory(d.t_str()) != 0);
#else
// Must change drive, too.
bool isDriveSpec = ((strlen(d) > 1) && (d[1] == ':'));
if (isDriveSpec)
{
wxChar firstChar = d[0];
// To upper case
if (firstChar > 90)
firstChar = firstChar - 32;
// To a drive number
unsigned int driveNo = firstChar - 64;
if (driveNo > 0)
{
unsigned int noDrives;
_dos_setdrive(driveNo, &noDrives);
}
}
success = (chdir(WXSTRINGCAST d) == 0);
#endif
#endif
if ( !success )
{