From 41336505c62a3f4b7853d9ac5e075a492b650df9 Mon Sep 17 00:00:00 2001 From: vladmarica Date: Sun, 23 Jan 2022 10:40:12 -0800 Subject: [PATCH] Fix FileUtils::isDirectory not handling errors correctly on Win32 --- CLI/FileUtils.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CLI/FileUtils.cpp b/CLI/FileUtils.cpp index cb993dfe..5e1e9047 100644 --- a/CLI/FileUtils.cpp +++ b/CLI/FileUtils.cpp @@ -190,7 +190,10 @@ bool traverseDirectory(const std::string& path, const std::function getSourceFiles(int argc, char** argv) for (int i = 1; i < argc; ++i) { - if (argv[i][0] == '-') + // Treat '-' as a special file whose source is read from stdin + // All other arguments that start with '-' are skipped + if (argv[i][0] == '-' && argv[i][1] != '\0') { continue; + } if (isDirectory(argv[i])) {