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.
This commit is contained in:
Holger Vogt 2025-09-04 00:03:25 +02:00
parent 0e8cc00070
commit ecb288138f
1 changed files with 4 additions and 0 deletions

View File

@ -9867,6 +9867,10 @@ char* get_windows_canonical_path(const char* input_path) {
return NULL; return NULL;
} }
/* If plain filename, just copy it. */
if (!strchr(input_path, '\\') && !strchr(input_path, '/'))
return copy(input_path);
inputLenMB = (int)strlen(input_path); inputLenMB = (int)strlen(input_path);
if (inputLenMB == 0) { if (inputLenMB == 0) {