From 26d8565fd55399e679baf7d6a8ab16d944970e31 Mon Sep 17 00:00:00 2001 From: firewave Date: Mon, 17 Feb 2025 00:33:04 +0100 Subject: [PATCH] FileLister: do not report an error on Windows when the given path does not exist --- cli/filelister.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cli/filelister.cpp b/cli/filelister.cpp index 567ac3d784b..268764b7dc7 100644 --- a/cli/filelister.cpp +++ b/cli/filelister.cpp @@ -86,8 +86,9 @@ static std::string addFiles2(std::list&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) + ")";