From 06f9d310ce95fe2d01a41b9a74d84930fa892ed4 Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Sun, 2 Oct 2011 12:02:07 +0300 Subject: [PATCH] CLI: case-insensitive ignorepath matching in Windows. --- cli/cppcheckexecutor.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cli/cppcheckexecutor.cpp b/cli/cppcheckexecutor.cpp index f32ca39d9..f84233997 100644 --- a/cli/cppcheckexecutor.cpp +++ b/cli/cppcheckexecutor.cpp @@ -130,7 +130,13 @@ bool CppCheckExecutor::parseFromArgs(CppCheck *cppcheck, int argc, const char* c std::vector::iterator iterBegin = filenames.begin(); for (int i = (int)filenames.size() - 1; i >= 0; i--) { - if (matcher.Match(filenames[(unsigned int)i])) +#if defined(_WIN32) + // For Windows we want case-insensitive path matching + const bool caseSensitive = false; +#else + const bool caseSensitive = true; +#endif + if (matcher.Match(filenames[(unsigned int)i], caseSensitive)) filenames.erase(iterBegin + i); } }