platform.cpp: Fix that platform files on Windows are not found (#1096)
* platform.cpp: Fix that platform files on Windows are not found I suggested this change here: https://trac.cppcheck.net/ticket/8242#comment:7 * Use fromNativeSeparators() and only search for forwardslash
This commit is contained in:
parent
defb74c0fe
commit
54d1490c89
|
@ -161,7 +161,7 @@ bool cppcheck::Platform::platformFile(const char exename[], const std::string &f
|
||||||
if (doc.LoadFile(filename.c_str()) != tinyxml2::XML_SUCCESS) {
|
if (doc.LoadFile(filename.c_str()) != tinyxml2::XML_SUCCESS) {
|
||||||
std::vector<std::string> filenames;
|
std::vector<std::string> filenames;
|
||||||
filenames.push_back(filename + ".xml");
|
filenames.push_back(filename + ".xml");
|
||||||
if (exename && strchr(exename, '/')) {
|
if (exename && (std::string::npos != Path::fromNativeSeparators(exename).find('/'))) {
|
||||||
filenames.push_back(Path::getPathFromFilename(Path::fromNativeSeparators(exename)) + "platforms/" + filename);
|
filenames.push_back(Path::getPathFromFilename(Path::fromNativeSeparators(exename)) + "platforms/" + filename);
|
||||||
filenames.push_back(Path::getPathFromFilename(Path::fromNativeSeparators(exename)) + "platforms/" + filename + ".xml");
|
filenames.push_back(Path::getPathFromFilename(Path::fromNativeSeparators(exename)) + "platforms/" + filename + ".xml");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue