ImportProject: Fix loading of sln without BOM
This commit is contained in:
parent
260d155bb6
commit
cfe2392709
|
@ -466,16 +466,18 @@ bool ImportProject::importSln(std::istream &istr, const std::string &path, const
|
||||||
{
|
{
|
||||||
std::string line;
|
std::string line;
|
||||||
|
|
||||||
// skip magic word
|
|
||||||
if (!std::getline(istr,line)) {
|
if (!std::getline(istr,line)) {
|
||||||
printError("Visual Studio solution file is empty");
|
printError("Visual Studio solution file is empty");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (line.find("Microsoft Visual Studio Solution File") != 0) {
|
||||||
|
// Skip BOM
|
||||||
if (!std::getline(istr, line) || line.find("Microsoft Visual Studio Solution File") != 0) {
|
if (!std::getline(istr, line) || line.find("Microsoft Visual Studio Solution File") != 0) {
|
||||||
printError("Visual Studio solution file header not found");
|
printError("Visual Studio solution file header not found");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
std::map<std::string,std::string,cppcheck::stricmp> variables;
|
std::map<std::string,std::string,cppcheck::stricmp> variables;
|
||||||
variables["SolutionDir"] = path;
|
variables["SolutionDir"] = path;
|
||||||
|
|
Loading…
Reference in New Issue