diff options
author | Valentyn Korniienko <kornienko-vr@rambler.ru> | 2020-06-18 16:26:13 +0300 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-06-21 19:31:39 +0200 |
commit | e39a6e2ceaa5a2ad70f4f6aa5ed7056b25a52ccd (patch) | |
tree | c3aad4bb73f729fe16bed82ea8aa1c0480191d6b /lib/curl_multibyte.c | |
parent | 3f84b3e39a36b408d1a8cc603435a356b39b6c50 (diff) | |
download | curl-e39a6e2ceaa5a2ad70f4f6aa5ed7056b25a52ccd.tar.gz |
multibyte: Fixed access-> waccess to file for Windows Plarform
Reviewed-by: Marcel Raad
Closes #5580
Diffstat (limited to 'lib/curl_multibyte.c')
-rw-r--r-- | lib/curl_multibyte.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/curl_multibyte.c b/lib/curl_multibyte.c index 5345d7b36..2c8925b53 100644 --- a/lib/curl_multibyte.c +++ b/lib/curl_multibyte.c @@ -129,4 +129,25 @@ int curlx_win32_stat(const char *path, struct_stat *buffer) return result; } +int curlx_win32_access(const char *path, int mode) +{ + int result = -1; +#ifdef _UNICODE + wchar_t *path_w = curlx_convert_UTF8_to_wchar(path); +#endif /* _UNICODE */ + +#if defined(_UNICODE) + if(path_w) + result = _waccess(path_w, mode); + else +#endif /* _UNICODE */ + result = _access(path, mode); + +#ifdef _UNICODE + free(path_w); +#endif + + return result; +} + #endif /* USE_WIN32_LARGE_FILES || USE_WIN32_SMALL_FILES */ |