diff options
author | atomlong | 2021-08-28 11:19:04 +0800 |
---|---|---|
committer | atomlong | 2021-08-28 13:15:13 +0800 |
commit | 89a67c05174951d172252b1db96ff93cc4ec4bcd (patch) | |
tree | d8c39fa79b201cf9aea28c51e7446a252ed8fee4 /0040-mingw-add-ModuleFileName-dir-to-PATH.patch | |
parent | cf8d8d8771493a2aa8370ed323d06dc733a84181 (diff) | |
download | aur-89a67c05174951d172252b1db96ff93cc4ec4bcd.tar.gz |
Update to 3.9.6
Diffstat (limited to '0040-mingw-add-ModuleFileName-dir-to-PATH.patch')
-rw-r--r-- | 0040-mingw-add-ModuleFileName-dir-to-PATH.patch | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/0040-mingw-add-ModuleFileName-dir-to-PATH.patch b/0040-mingw-add-ModuleFileName-dir-to-PATH.patch new file mode 100644 index 000000000000..c04ca93b169c --- /dev/null +++ b/0040-mingw-add-ModuleFileName-dir-to-PATH.patch @@ -0,0 +1,58 @@ +From a8c10ce1867cef6470abf110d26cfc47ed4c5e5a Mon Sep 17 00:00:00 2001 +From: Ray Donnelly <mingw.android@gmail.com> +Date: Thu, 17 Jun 2021 18:51:48 +0530 +Subject: [PATCH 040/N] mingw add ModuleFileName dir to PATH +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Алексей <alexey.pawlow@gmail.com> +Co-authored-by: Christoph Reiter <reiter.christoph@gmail.com> +--- + Modules/getpath.c | 30 ++++++++++++++++++++++++++++++ + 1 file changed, 30 insertions(+) + +diff --git a/Modules/getpath.c b/Modules/getpath.c +index 3010182..c52e0df 100644 +--- a/Modules/getpath.c ++++ b/Modules/getpath.c +@@ -1641,6 +1641,36 @@ calculate_path(PyCalculatePath *calculate, _PyPathConfig *pathconfig) + return status; + } + ++#ifdef MS_WINDOWS ++ if (calculate->path_env) { ++ wchar_t *module_path, *norm_path; ++ // Add path of executable/dll to system path. This ++ // is so that the correct tcl??.dll and tk??.dll get used. ++ module_path = calculate->dll_path[0] ? calculate->dll_path : pathconfig->program_full_path; ++ norm_path = (wchar_t *)alloca(sizeof(wchar_t) * (wcslen(module_path) + 1)); ++ if (norm_path) { ++ wchar_t *slashes, *end, *new_path; ++ wcscpy(norm_path, module_path); ++ slashes = wcschr(norm_path, L'/'); ++ while (slashes) { ++ *slashes = L'\\'; ++ slashes = wcschr(slashes + 1, L'/'); ++ } ++ end = wcsrchr(norm_path, L'\\') ? wcsrchr(norm_path, L'\\') : norm_path + wcslen(norm_path); ++ end[1] = L'\0'; ++ ++ new_path = (wchar_t *)alloca(sizeof(wchar_t) * (wcslen(L"PATH=") + wcslen(calculate->path_env) + 1 + wcslen(norm_path) + 1)); ++ if (new_path) { ++ wcscpy(new_path, L"PATH="); ++ wcscat(new_path, calculate->path_env); ++ wcscat(new_path, L";"); ++ wcscat(new_path, norm_path); ++ _wputenv(new_path); ++ } ++ } ++ } ++#endif ++ + if ((!calculate->prefix_found || !calculate->exec_prefix_found) + && calculate->warnings) + { +-- +2.32.0 + |