mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 17:38:00 +00:00
f_open: use non-Unicode pathnames on legacy Windows.
This commit is contained in:
parent
b5fe588bac
commit
5a9f8c3062
@ -86,6 +86,15 @@ char filename_char_sanitise(char c)
|
||||
|
||||
FILE *f_open(const Filename *fn, const char *mode, bool isprivate)
|
||||
{
|
||||
#ifdef LEGACY_WINDOWS
|
||||
/* Fallback for legacy pre-NT windows, where as far as I can see
|
||||
* _wfopen just doesn't work at all */
|
||||
init_winver();
|
||||
if (osPlatformId == VER_PLATFORM_WIN32_WINDOWS ||
|
||||
osPlatformId == VER_PLATFORM_WIN32s)
|
||||
return fopen(fn->cpath, mode);
|
||||
#endif
|
||||
|
||||
wchar_t *wmode = dup_mb_to_wc(DEFAULT_CODEPAGE, mode);
|
||||
FILE *fp = _wfopen(fn->wpath, wmode);
|
||||
sfree(wmode);
|
||||
|
Loading…
Reference in New Issue
Block a user