From ecb288138f5ba3bce0a173ab1e0288f55e54984c Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Thu, 4 Sep 2025 00:03:25 +0200 Subject: [PATCH] Fix a bug in the Windows Builds: With commit 80d6e681f ("MS Windows: Get a canonical paths name: Important if path length exceeds MAX_PATH, might happen when using PDKs", 2025-04-12) the newly introduced function get_windows_canonical_path() does not do the right thing when the path name is only a simple file name. Then internally used function GetFullPathNameW() then will prepend the current directory to the file name, which may be simply wrong. --- src/frontend/inpcom.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index ff9bb8072..86d2534f7 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -9867,6 +9867,10 @@ char* get_windows_canonical_path(const char* input_path) { return NULL; } + /* If plain filename, just copy it. */ + if (!strchr(input_path, '\\') && !strchr(input_path, '/')) + return copy(input_path); + inputLenMB = (int)strlen(input_path); if (inputLenMB == 0) {