Skip to content

Commit

Permalink
FileLister: do not report an error on Windows when the given path doe…
Browse files Browse the repository at this point in the history
…s not exist
  • Loading branch information
firewave committed Feb 16, 2025
1 parent 3a1c34d commit 26d8565
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cli/filelister.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ static std::string addFiles2(std::list<FileWithDetails>&files, const std::string
HANDLE hFind = FindFirstFileA(searchPattern.c_str(), &ffd);
if (INVALID_HANDLE_VALUE == hFind) {
const DWORD err = GetLastError();
if (err == ERROR_FILE_NOT_FOUND) {
// no files matched
if (err == ERROR_FILE_NOT_FOUND || // the pattern did not match anything
err == ERROR_PATH_NOT_FOUND) // the given search path does not exist
{
return "";
}
return "finding files failed. Search pattern: '" + searchPattern + "'. (error: " + std::to_string(err) + ")";
Expand Down

0 comments on commit 26d8565

Please sign in to comment.