From: Stefan Neis Date: Sun, 7 Jan 2007 18:22:57 +0000 (+0000) Subject: Fixed switching to a different drive/volume on OS/2. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/43c974071f54aaf4ab906b2ac9f27098cd7534b0 Fixed switching to a different drive/volume on OS/2. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44133 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index 1d0a96278c..1f87e838c5 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -1575,6 +1575,14 @@ wxString wxGetCwd() bool wxSetWorkingDirectory(const wxString& d) { #if defined(__OS2__) + if (d[1] == ':') + { + ::DosSetDefaultDisk(1 + wxToupper(d[0]) - _T('A')); + // do not call DosSetCurrentDir when just changing drive, + // since it requires e.g. "d:." instead of "d:"! + if (d.length() == 2) + return true; + } return (::DosSetCurrentDir((PSZ)d.c_str()) == 0); #elif defined(__UNIX__) || defined(__WXMAC__) || defined(__DOS__) return (chdir(wxFNSTRINGCAST d.fn_str()) == 0);