Package: cppcheck / 2.3-1

load-cfg-relative-to-executable-before-filesdir Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Description: Load cfg files relative to executable before considering
  FILESDIR, such that the testrunner uses the local files instead of those
  from an installed cppcheck.
Author: Joachim Reichel <reichel@debian.org>

Index: cppcheck/lib/library.cpp
===================================================================
--- cppcheck.orig/lib/library.cpp
+++ cppcheck/lib/library.cpp
@@ -96,14 +96,14 @@ Library::Error Library::load(const char
         }
 
         std::list<std::string> cfgfolders;
-#ifdef FILESDIR
-        cfgfolders.emplace_back(FILESDIR "/cfg");
-#endif
         if (exename) {
             const std::string exepath(Path::fromNativeSeparators(Path::getPathFromFilename(exename)));
             cfgfolders.push_back(exepath + "cfg");
             cfgfolders.push_back(exepath);
         }
+#ifdef FILESDIR
+        cfgfolders.emplace_back(FILESDIR "/cfg");
+#endif
 
         while (error == tinyxml2::XML_ERROR_FILE_NOT_FOUND && !cfgfolders.empty()) {
             const std::string cfgfolder(cfgfolders.back());