https://bugs.winehq.org/show_bug.cgi?id=46823
Bug ID: 46823 Summary: in wcmd.exe, trailing slash in "if exist SomeDir/" cause always false Product: Wine Version: 4.3 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: cmd Assignee: wine-bugs@winehq.org Reporter: alter@ukr.net Distribution: ---
Created attachment 63849 --> https://bugs.winehq.org/attachment.cgi?id=63849 fix issue with instant false due to trailing slash in 'if exist SomeDir/'
if exist SomeDir/ do-smth.cmd statement (with ending slash) always return false since 'if exist' CMD implementation start using FindFirstFileW() instead of GetFileAttributesW() in builtins.c Such condition appears in MS VisualStudio generated makefiles There is special case for trailing '\', but there is no handling for '/'. The patch proposed fixes this issue and adds corresponding tests for if exist SomeDir/ do-smth.cmd if exist "SomeDir/" do-smth.cmd cases