From db849eb3e5ec110645d1561e38cd0dc102d4def2 Mon Sep 17 00:00:00 2001 From: kssenii Date: Fri, 14 May 2021 10:06:38 +0300 Subject: [PATCH] Remaining poco --- src/Disks/IDisk.h | 2 ++ src/Interpreters/ExternalLoaderXMLConfigRepository.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Disks/IDisk.h b/src/Disks/IDisk.h index 459991d6afd..2e83bf0ec26 100644 --- a/src/Disks/IDisk.h +++ b/src/Disks/IDisk.h @@ -301,6 +301,8 @@ inline String fullPath(const DiskPtr & disk, const String & path) /// Return parent path for the specified path. inline String parentPath(const String & path) { + if (path.ends_with('/')) + return fs::path(path).parent_path().parent_path() / ""; return fs::path(path).parent_path() / ""; } diff --git a/src/Interpreters/ExternalLoaderXMLConfigRepository.cpp b/src/Interpreters/ExternalLoaderXMLConfigRepository.cpp index e4f3447c6df..4c6af554fae 100644 --- a/src/Interpreters/ExternalLoaderXMLConfigRepository.cpp +++ b/src/Interpreters/ExternalLoaderXMLConfigRepository.cpp @@ -40,8 +40,8 @@ std::set ExternalLoaderXMLConfigRepository::getAllLoadablesDefiniti if (pattern[0] != '/') { const auto app_config_path = main_config.getString("config-file", "config.xml"); - const auto config_dir = Poco::Path{app_config_path}.parent().toString(); - const auto absolute_path = config_dir + pattern; + const String config_dir = fs::path(app_config_path).parent_path(); + const String absolute_path = fs::path(config_dir) / pattern; Poco::Glob::glob(absolute_path, files, 0); if (!files.empty()) continue;