]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
curl_multibyte: remove access() function wrapper for Windows
authorJay Satiro <raysatiro@yahoo.com>
Fri, 3 May 2024 23:31:00 +0000 (19:31 -0400)
committerJay Satiro <raysatiro@yahoo.com>
Tue, 7 May 2024 06:28:10 +0000 (02:28 -0400)
- Remove curlx_win32_access() which was a wrapper to use access() in
  Windows.

This is a follow-up to 602fc213, one of two commits which removed
access() calls from the codebase and banned use of the function.

Closes https://github.com/curl/curl/pull/13529

lib/curl_multibyte.c
lib/curl_setup.h
scripts/checksrc.pl

index ff21098563b77846a1600c54f252115d9fabb1a6..86ac74ff4b065927bead5cfe1435659dd76ac553 100644 (file)
@@ -159,21 +159,4 @@ int curlx_win32_stat(const char *path, struct_stat *buffer)
 #endif
 }
 
-int curlx_win32_access(const char *path, int mode)
-{
-#if defined(_UNICODE)
-  int result = -1;
-  wchar_t *path_w = curlx_convert_UTF8_to_wchar(path);
-  if(path_w) {
-    result = _waccess(path_w, mode);
-    curlx_unicodefree(path_w);
-  }
-  else
-    errno = EINVAL;
-  return result;
-#else
-  return _access(path, mode);
-#endif
-}
-
 #endif /* USE_WIN32_LARGE_FILES || USE_WIN32_SMALL_FILES */
index a4b8ba3b6629b827c3cd9230c8975abe640e5367..0fcb2bded3431df00d84cdcb67c304b2d147457e 100644 (file)
 #  define LSEEK_ERROR                (__int64)-1
 #  define open                       curlx_win32_open
 #  define fopen(fname,mode)          curlx_win32_fopen(fname, mode)
-#  define access(fname,mode)         curlx_win32_access(fname, mode)
    int curlx_win32_open(const char *filename, int oflag, ...);
    int curlx_win32_stat(const char *path, struct_stat *buffer);
    FILE *curlx_win32_fopen(const char *filename, const char *mode);
-   int curlx_win32_access(const char *path, int mode);
 #endif
 
 /*
 #    define struct_stat                struct _stat
 #    define open                       curlx_win32_open
 #    define fopen(fname,mode)          curlx_win32_fopen(fname, mode)
-#    define access(fname,mode)         curlx_win32_access(fname, mode)
      int curlx_win32_stat(const char *path, struct_stat *buffer);
      int curlx_win32_open(const char *filename, int oflag, ...);
      FILE *curlx_win32_fopen(const char *filename, const char *mode);
-     int curlx_win32_access(const char *path, int mode);
 #  endif
 #  define LSEEK_ERROR                (long)-1
 #endif
index ed3de7c1e46b0a975917767e0adb21a0bc0116cd..75f68fbaaa85e353ce59069aad452534a60e7e4a 100755 (executable)
@@ -721,7 +721,7 @@ sub scanfile {
                     v?sprintf|
                     (str|_mbs|_tcs|_wcs)n?cat|
                     LoadLibrary(Ex)?(A|W)?|
-                    access)
+                    _?w?access)
                    \s*\(
                  /x) {
             checkwarn("BANNEDFUNC",