فهرست منبع

Merge topic 'libuv-win-no-default-current-directory' into release-3.28

ab561b86fb libuv: win: honor NoDefaultCurrentDirectoryInExePath env var

Acked-by: Kitware Robot <[email protected]>
Merge-request: !9022
Brad King 2 سال پیش
والد
کامیت
b9970be9bc
1فایلهای تغییر یافته به همراه6 افزوده شده و 4 حذف شده
  1. 6 4
      Utilities/cmlibuv/src/win/process.c

+ 6 - 4
Utilities/cmlibuv/src/win/process.c

@@ -391,10 +391,12 @@ static WCHAR* search_path(const WCHAR *file,
   } else {
     dir_end = path;
 
-    /* The file is really only a name; look in cwd first, then scan path */
-    result = path_search_walk_ext(L"", 0,
-                                  file, file_len,
-                                  cwd, cwd_len);
+    if (NeedCurrentDirectoryForExePathW(L"")) {
+      /* The file is really only a name; look in cwd first, then scan path */
+      result = path_search_walk_ext(L"", 0,
+                                    file, file_len,
+                                    cwd, cwd_len);
+    }
 
     while (result == NULL) {
       if (dir_end == NULL || *dir_end == L'\0') {