From 094286e06f0ff154f20fcccce0c71068a3d216d5 Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Mon, 21 Apr 2008 17:58:38 +0200 Subject: Fixed bug 3011 --- cpp/src/Slice/Preprocessor.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'cpp/src/Slice/Preprocessor.cpp') diff --git a/cpp/src/Slice/Preprocessor.cpp b/cpp/src/Slice/Preprocessor.cpp index b5efe23096e..d5231c06fbe 100755 --- a/cpp/src/Slice/Preprocessor.cpp +++ b/cpp/src/Slice/Preprocessor.cpp @@ -255,6 +255,13 @@ Slice::Preprocessor::printMakefileDependencies(Language lang, const vector fullIncludePaths; + vector::const_iterator p; + for(p = includePaths.begin(); p != includePaths.end(); ++p) + { + fullIncludePaths.push_back(fullPath(*p)); + } + // // Process each dependency. // @@ -264,25 +271,18 @@ Slice::Preprocessor::printMakefileDependencies(Language lang, const vector::const_iterator p = includePaths.begin(); p != includePaths.end(); ++p) + for(vector::const_iterator p = fullIncludePaths.begin(); p != fullIncludePaths.end(); ++p) { - string includePath = *p; - if(!isAbsolute(includePath)) - { - includePath = cwd + "/" + includePath; - } - includePath = normalizePath(includePath, false); - - if(file.compare(0, includePath.length(), includePath) == 0) + if(file.compare(0, p->length(), *p) == 0) { - string s = *p + file.substr(includePath.length()); + string s = includePaths[p - fullIncludePaths.begin()] + file.substr(p->length()); if(isAbsolute(newFile) || s.size() < newFile.size()) { newFile = s; -- cgit v1.2.3