mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 14:38:18 +00:00
Use SetCurrentDirectoryW
instead of _wchdir
For more consistent usage of the Windows API. `_wchdir` seems to be a wrapper around `SetCurrentDirectoryW` anyway, at least in the [Wine API](https://source.winehq.org/ident?_i=_wchdir).
This commit is contained in:
parent
8fb79242bf
commit
2ba67c2306
|
@ -2345,10 +2345,7 @@ int fs_chdir(const char *path)
|
|||
#if defined(CONF_FAMILY_WINDOWS)
|
||||
WCHAR wBuffer[IO_MAX_PATH_LENGTH];
|
||||
MultiByteToWideChar(CP_UTF8, 0, path, -1, wBuffer, std::size(wBuffer));
|
||||
if(_wchdir(wBuffer))
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
return SetCurrentDirectoryW(wBuffer) != 0 ? 0 : 1;
|
||||
#else
|
||||
if(chdir(path))
|
||||
return 1;
|
||||
|
|
Loading…
Reference in a new issue