From: Eric Pouech epouech@codeweavers.com
https://bugs.winehq.org/show_bug.cgi?id=57245
Signed-off-by: Eric Pouech epouech@codeweavers.com --- programs/cmd/tests/test_builtins.cmd.exp | 2 +- programs/cmd/wcmdmain.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp index bb87e28acaf..cf500a516de 100644 --- a/programs/cmd/tests/test_builtins.cmd.exp +++ b/programs/cmd/tests/test_builtins.cmd.exp @@ -1825,7 +1825,7 @@ abc %WINE_BAR% %WINE_BAR% abc def def --- search with dots a -@todo_wine@b +b fail2 --- builtin in expansions bar p1 echo diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c index 0d3b201c095..46131cad608 100644 --- a/programs/cmd/wcmdmain.c +++ b/programs/cmd/wcmdmain.c @@ -1620,8 +1620,8 @@ static RETURN_CODE search_command(WCHAR *command, struct search_command *sc, BOO DWORD attribs = GetFileAttributesW(sc->path); found = attribs != INVALID_FILE_ATTRIBUTES && !(attribs & FILE_ATTRIBUTE_DIRECTORY); } - else - found = search_in_pathext(sc->path); + /* if foo.bat was given but not found, try to match foo.bat.bat (or any valid ext) */ + if (!found) found = search_in_pathext(sc->path); if (found) return NO_ERROR; } return RETURN_CODE_CANT_LAUNCH;