From b384aabc52b17c62888fde5fbd61e40fdf3553c0 Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Sun, 18 Jul 2010 20:02:18 +0300 Subject: [PATCH] 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. --- lib/preprocessor.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/preprocessor.cpp b/lib/preprocessor.cpp index 09d45ae50..f094da45e 100644 --- a/lib/preprocessor.cpp +++ b/lib/preprocessor.cpp @@ -1397,7 +1397,11 @@ void Preprocessor::handleIncludes(std::string &code, const std::string &filePath if (headerType == 1 && !fileOpened) { 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()) { fileOpened = true;