Get rid of some Win16 code from wxSetWorkingDirectory
This commit is contained in:
@@ -1390,31 +1390,7 @@ bool wxSetWorkingDirectory(const wxString& d)
|
|||||||
#if defined(__UNIX__) || defined(__WXMAC__)
|
#if defined(__UNIX__) || defined(__WXMAC__)
|
||||||
success = (chdir(wxFNSTRINGCAST d.fn_str()) == 0);
|
success = (chdir(wxFNSTRINGCAST d.fn_str()) == 0);
|
||||||
#elif defined(__WINDOWS__)
|
#elif defined(__WINDOWS__)
|
||||||
|
|
||||||
#ifdef __WIN32__
|
|
||||||
success = (SetCurrentDirectory(d.t_str()) != 0);
|
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
|
#endif
|
||||||
if ( !success )
|
if ( !success )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user