From fbf5b68d6f901aa5bac19725a45cd643c134969b Mon Sep 17 00:00:00 2001 From: Guy Magen Date: Thu, 9 Sep 2021 10:23:44 +0000 Subject: [PATCH] Fixed ftp bug Fixed ftp bug --- src/util.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/util.cc b/src/util.cc index 9f61daeb80..a16728370d 100644 --- a/src/util.cc +++ b/src/util.cc @@ -675,7 +675,15 @@ string normalize_path(std::string_view path) if (0 == path.compare(zeek::detail::ScannedFile::canonical_stdin_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 if ( path.find("/.") == std::string_view::npos && path.find("//") == std::string_view::npos ) {