Fixed ftp bug

Fixed ftp bug
This commit is contained in:
Guy Magen 2021-09-09 10:23:44 +00:00 committed by Tomer Lev
parent 7b37194a48
commit fbf5b68d6f

View file

@ -675,7 +675,15 @@ string normalize_path(std::string_view path)
if (0 == path.compare(zeek::detail::ScannedFile::canonical_stdin_path)) { if (0 == path.compare(zeek::detail::ScannedFile::canonical_stdin_path)) {
return string(path); return string(path);
} }
return std::filesystem::canonical(path).string(); string stringPath = string(path);
// "//" interferes with std::weakly_canonical
if (stringPath._Starts_with("//"))
{
stringPath.erase(0, 2);
}
return std::filesystem::weakly_canonical(path).string();
#else #else
if ( path.find("/.") == std::string_view::npos && path.find("//") == std::string_view::npos ) if ( path.find("/.") == std::string_view::npos && path.find("//") == std::string_view::npos )
{ {