Fixed #1371 (#include "foo\file.h" -> #include "foo/file.h" should be handled automatically on linux)

Linux can't open file paths with / separator. So we'll need to fix
such include file paths (in source files) first.
This commit is contained in:
Kimmo Varis 2010-07-18 20:02:18 +03:00
parent 5ab36d8a6d
commit b384aabc52
1 changed files with 5 additions and 1 deletions

View File

@ -1397,7 +1397,11 @@ void Preprocessor::handleIncludes(std::string &code, const std::string &filePath
if (headerType == 1 && !fileOpened) if (headerType == 1 && !fileOpened)
{ {
filename = paths.back() + filename; filename = paths.back() + filename;
fin.open(filename.c_str());
// Linux can't open include paths with \ separator, so fix them
std::string fixedname(filename);
std::replace(fixedname.begin(), fixedname.end(), '\\', '/');
fin.open(fixedname.c_str());
if (fin.is_open()) if (fin.is_open())
{ {
fileOpened = true; fileOpened = true;