diff --git a/libsolidity/interface/FileReader.cpp b/libsolidity/interface/FileReader.cpp index a1ea61b6fbe6..db751e67c4cd 100644 --- a/libsolidity/interface/FileReader.cpp +++ b/libsolidity/interface/FileReader.cpp @@ -142,7 +142,6 @@ boost::filesystem::path FileReader::normalizeCLIPathForVFS(boost::filesystem::pa // If the path is on the same drive as the working dir, for portability we prefer not to // include the root name. Do this only for non-UNC paths - my experiments show that on Windows // when the working dir is an UNC path, / does not not actually refer to the root of the UNC path. - // For UNC paths only normalize the root name to start with //. boost::filesystem::path normalizedRootPath = normalizedPath.root_path(); if (!isUNCPath(normalizedPath)) { @@ -150,20 +149,6 @@ boost::filesystem::path FileReader::normalizeCLIPathForVFS(boost::filesystem::pa if (normalizedRootPath == workingDirRootPath) normalizedRootPath = "/"; } - else - { - solAssert( - boost::starts_with(normalizedPath.root_name().string(), "//") || - boost::starts_with(normalizedPath.root_name().string(), "\\\\"), - "" - ); - - string rootName = normalizedPath.root_name().string(); - boost::filesystem::path normalizedRootPath = - normalizedPath.root_directory().string() + - "//" + - (rootName.size() > 2 ? rootName.substr(2, string::npos) : ""); - } boost::filesystem::path normalizedPathNoDotDot = normalizedPath; if (dotDotPrefix.empty()) @@ -174,6 +159,7 @@ boost::filesystem::path FileReader::normalizeCLIPathForVFS(boost::filesystem::pa // NOTE: On Windows lexically_normal() converts all separators to forward slashes. Convert them back. // Separators do not affect path comparison but remain in internal representation returned by native(). + // This will also normalize the root name to start with // in UNC paths. normalizedPathNoDotDot = normalizedPathNoDotDot.generic_string(); // For some reason boost considers "/." different than "/" even though for other directories