eric pouech (@epo) commented about programs/cmd/builtins.c:
+ continue; + } + + lstrcpyW(fileNamePart, fd.cFileName); + + hIn = CreateFileW(srcpath, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, NULL, OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL, NULL); + + if (hIn == INVALID_HANDLE_VALUE) { + return_code = ERROR_INVALID_FUNCTION; + WCMD_print_error (); + WCMD_output_stderr(WCMD_LoadMessage(WCMD_READFAIL), srcpath); + + FindClose(hff); + + /* Invalid directory path; Return immediately */ I'm not sure this is fully correct
from your explanations, you want to distinguish from directory that doesn't exist from error when opening the file (in an existing directory) testing for '\\' doesn't seem fully correct could you discriminate based on GetLastError() value? it may return ERROR_PATH_NOT_FOUND when directory doesn't exist (and some other errors FILE_NOT_FOUND is file doesn't exist whilst directory exists, and other errors (access denied...)) -- https://gitlab.winehq.org/wine/wine/-/merge_requests/11094#note_143626