From 8ace851831f63035174ae086bb415a0d2efb8277 Mon Sep 17 00:00:00 2001 From: VoR0220 Date: Tue, 10 Jan 2017 07:15:48 -0600 Subject: much smaller helper function Signed-off-by: VoR0220 --- libsolidity/interface/CompilerStack.cpp | 6 ++---- libsolidity/interface/CompilerStack.h | 4 +++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index 1a95f5a6..094360a3 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -515,10 +515,8 @@ string CompilerStack::applyRemapping(string const& _path, string const& _context for (auto const& redir: m_remappings) { - filepath redirContext(redir.context); - filepath redirPrefix(redir.prefix); - string contextFileString = redirContext.generic_string(); - string prefixFileString = redirPrefix.generic_string(); + string contextFileString = sanitizePath(redir.context); + string prefixFileString = sanitizePath(redir.prefix); // Skip if there is a prefix collision and the current context is closer if (longestContext > 0 && contextFileString.length() < longestContext) continue; diff --git a/libsolidity/interface/CompilerStack.h b/libsolidity/interface/CompilerStack.h index f98a457a..ef0aa6fe 100644 --- a/libsolidity/interface/CompilerStack.h +++ b/libsolidity/interface/CompilerStack.h @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -239,7 +240,8 @@ private: ContractDefinition const& _contract, std::map& _compiledContracts ); - + /// Helper function to return path converted strings. + std::string sanitizePath(std::string const& _path) { return boost::filesystem::path(_path).generic_string(); } void link(); Contract const& contract(std::string const& _contractName = "") const; -- cgit