From 3d772edc7a18451f16d71aebecb9acbd84461eea Mon Sep 17 00:00:00 2001 From: ssi91 Date: Fri, 17 Apr 2020 03:29:40 +0700 Subject: [PATCH] handle file prefix add the description to the changelog fix: use the right method to search in string follow the codestyle using tabs delete redundant declaration implement the handling inline Update Changelog.md Co-Authored-By: Leonardo --- Changelog.md | 1 + solc/CommandLineInterface.cpp | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index 6a7042e6f..ec45f9da7 100644 --- a/Changelog.md +++ b/Changelog.md @@ -15,6 +15,7 @@ Bugfixes: * Type Checker: Fix several internal errors by performing size and recursiveness checks of types before the full type checking. * Type Checker: Fix internal error when assigning to empty tuples. * Type Checker: Perform recursiveness check on structs declared at the file level. + * Standard Json Input: Fix error when using prefix ``file://`` in the field ``urls``. Build System: * soltest.sh: ``SOLIDITY_BUILD_DIR`` is no longer relative to ``REPO_ROOT`` to allow for build directories outside of the source tree. diff --git a/solc/CommandLineInterface.cpp b/solc/CommandLineInterface.cpp index da14c58f9..537b2096b 100644 --- a/solc/CommandLineInterface.cpp +++ b/solc/CommandLineInterface.cpp @@ -953,7 +953,10 @@ bool CommandLineInterface::processInput() "ReadFile callback used as callback kind " + _kind )); - auto path = boost::filesystem::path(_path); + string validPath = _path; + if (validPath.find("file://") == 0) + validPath.erase(0, 7); + auto path = boost::filesystem::path(validPath); auto canonicalPath = boost::filesystem::weakly_canonical(path); bool isAllowed = false; for (auto const& allowedDir: m_allowedDirectories)