X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c40158e40b45fd22c7a166ce1743345fb4d4a4d3..de9a407728e5f47ed416365da9c07798ad0b0b26:/src/common/filefn.cpp?ds=inline diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index 5355dd7e09..779c4dfa28 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -1363,10 +1363,6 @@ wxChar *wxGetWorkingDirectory(wxChar *buf, int sz) bool needsANSI = true; #if !defined(HAVE_WGETCWD) || wxUSE_UNICODE_MSLU - // This is not legal code as the compiler - // is allowed destroy the wxCharBuffer. - // wxCharBuffer c_buffer(sz); - // char *cbuf = (char*)(const char*)c_buffer; char cbuf[_MAXPATHLEN]; #endif @@ -1452,7 +1448,13 @@ wxChar *wxGetWorkingDirectory(wxChar *buf, int sz) #if defined( __CYGWIN__ ) && defined( __WINDOWS__ ) // another example of DOS/Unix mix (Cygwin) wxString pathUnix = buf; +#if wxUSE_UNICODE + char bufA[_MAXPATHLEN]; + cygwin_conv_to_full_win32_path(pathUnix.mb_str(wxConvFile), bufA); + wxConvFile.MB2WC(buf, bufA, sz); +#else cygwin_conv_to_full_win32_path(pathUnix, buf); +#endif // wxUSE_UNICODE #endif // __CYGWIN__ } @@ -1968,7 +1970,7 @@ wxFileKind wxGetFileKind(FILE *fp) (void)fp; return wxFILE_KIND_DISK; #else - return wxGetFileKind(fileno(fp)); + return fp ? wxGetFileKind(fileno(fp)) : wxFILE_KIND_UNKNOWN; #endif }