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());
