Module: wine Branch: master Commit: 0911d462f977aef1071b59b70cfa68398f13663b URL: https://gitlab.winehq.org/wine/wine/-/commit/0911d462f977aef1071b59b70cfa683...
Author: Liam Middlebrook lmiddlebrook@nvidia.com Date: Tue Jun 20 10:33:56 2023 -0700
cmd: Fix empty strings between PATH separators.
Previously if an empty string was encountered while parsing out PATH, cmd.exe would ignore the rest of the PATH entirely.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55097 Signed-off-by: Liam Middlebrook lmiddlebrook@nvidia.com
---
programs/cmd/wcmdmain.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c index 022ff6637c5..de6e721b26a 100644 --- a/programs/cmd/wcmdmain.c +++ b/programs/cmd/wcmdmain.c @@ -1135,6 +1135,12 @@ void WCMD_run_program (WCHAR *command, BOOL called) else lstrcpyW(temp, thisDir + 1);
+ /* When temp is an empty string, skip over it. This needs + to be done before the expansion, because WCMD_get_fullpath + fails when given an empty string */ + if (*temp == '\0') + continue; + /* Since you can have eg. .... on the path, need to expand to full information */ if (!WCMD_get_fullpath(temp, ARRAY_SIZE(thisDir), thisDir, NULL)) return;