aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorVoR0220 <rj@erisindustries.com>2017-01-12 01:45:14 +0800
committerVoR0220 <rj@erisindustries.com>2017-01-12 01:45:14 +0800
commit4542f459f165502ed9537bb570de44640cdc4228 (patch)
tree36be3a43e4b04b30ea2903a48aea717d3ef6007d /libsolidity
parent4585bfdce7716cd4837f71b565bb9a6dff8c2d7e (diff)
downloaddexon-solidity-4542f459f165502ed9537bb570de44640cdc4228.tar
dexon-solidity-4542f459f165502ed9537bb570de44640cdc4228.tar.gz
dexon-solidity-4542f459f165502ed9537bb570de44640cdc4228.tar.bz2
dexon-solidity-4542f459f165502ed9537bb570de44640cdc4228.tar.lz
dexon-solidity-4542f459f165502ed9537bb570de44640cdc4228.tar.xz
dexon-solidity-4542f459f165502ed9537bb570de44640cdc4228.tar.zst
dexon-solidity-4542f459f165502ed9537bb570de44640cdc4228.zip
added fix and a test for order independence of nested prefixing
Signed-off-by: VoR0220 <rj@erisindustries.com>
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/interface/CompilerStack.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp
index 1e571cae..e4c351ff 100644
--- a/libsolidity/interface/CompilerStack.cpp
+++ b/libsolidity/interface/CompilerStack.cpp
@@ -523,7 +523,7 @@ string CompilerStack::applyRemapping(string const& _path, string const& _context
if (!isPrefixOf(context, _context))
continue;
// Skip if we already have a closer prefix match.
- if (prefix.length() < longestPrefix)
+ if (prefix.length() < longestPrefix && context.length() == longestContext)
continue;
// Skip if the prefix does not match.
if (!isPrefixOf(prefix, _path))
@@ -534,7 +534,7 @@ string CompilerStack::applyRemapping(string const& _path, string const& _context
bestMatchTarget = redir.target;
}
- string path = longestPrefixTarget;
+ string path = bestMatchTarget;
path.append(_path.begin() + longestPrefix, _path.end());
return path;
}