From b383bae4ab784899d019ac80157159ff745426b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Thu, 8 Dec 2011 22:17:50 +0100 Subject: [PATCH] C++ Builder: Fixed compiler errors --- lib/preprocessor.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/preprocessor.cpp b/lib/preprocessor.cpp index 00331da40..8e8773743 100644 --- a/lib/preprocessor.cpp +++ b/lib/preprocessor.cpp @@ -1848,8 +1848,11 @@ std::string Preprocessor::handleIncludes(const std::string &code, const std::str } // try to open file + std::string filepath; + if (headerType == UserHeader) + filepath = path; std::ifstream fin; - if (!openHeader(filename, includePaths, headerType == UserHeader ? path : std::string(""), fin)) { + if (!openHeader(filename, includePaths, filepath, fin)) { if (_settings && (headerType == UserHeader || _settings->debugwarnings)) { if (!_settings->nomsg.isSuppressed("missingInclude", "", 0)) { @@ -1928,8 +1931,11 @@ void Preprocessor::handleIncludes(std::string &code, const std::string &filePath // filename contains now a file name e.g. "menu.h" std::string processedFile; + std::string filepath; + if (headerType == UserHeader) + filepath = paths.back(); std::ifstream fin; - const bool fileOpened(openHeader(filename, includePaths, headerType == UserHeader ? paths.back() : std::string(""), fin)); + const bool fileOpened(openHeader(filename, includePaths, filepath, fin)); if (fileOpened) { filename = Path::simplifyPath(filename.c_str());