From 6016d9fc1d2e20148baf8d2464f194fd4e14b9c4 Mon Sep 17 00:00:00 2001
From: Houtan Bastani <houtan@dynare.org>
Date: Fri, 28 Aug 2015 11:13:19 +0200
Subject: [PATCH] preprocessor: fix bug introduced in
 1ba04976aac043deca38edb03e0dfc866dfadd67. #1039

---
 preprocessor/macro/MacroFlex.ll | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/preprocessor/macro/MacroFlex.ll b/preprocessor/macro/MacroFlex.ll
index 72b4a4b51..994d2420f 100644
--- a/preprocessor/macro/MacroFlex.ll
+++ b/preprocessor/macro/MacroFlex.ll
@@ -401,7 +401,8 @@ MacroFlex::create_include_context(string *filename, Macro::parser::location_type
       dirs << "." << FILESEP << endl;
       for (vector<string>::const_iterator it = path.begin(); it != path.end(); it++)
         {
-          input = new ifstream(it->c_str() + FILESEP + filename->c_str(), ios::binary);
+          string testfile = *it + FILESEP + *filename;
+          input = new ifstream(testfile.c_str(), ios::binary);
           if (input->good())
             break;
           dirs << *it << endl;
-- 
GitLab