Fixed path filters on Windows
This commit is contained in:
@@ -391,8 +391,10 @@ tvl::value_t paths_filter::match(
|
||||
|
||||
auto pp = p.fs_path(root_);
|
||||
for (const auto &path : paths_) {
|
||||
if (util::starts_with(pp, path))
|
||||
if (pp.root_name().string() == path.root_name().string() &&
|
||||
util::starts_with(pp, path)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -37,7 +37,11 @@ namespace clanguml::common::model {
|
||||
enum class source_file_t { kDirectory, kHeader, kImplementation };
|
||||
|
||||
struct fs_path_sep {
|
||||
#ifdef _WIN32
|
||||
static constexpr std::string_view value = "\\";
|
||||
#else
|
||||
static constexpr std::string_view value = "/";
|
||||
#endif
|
||||
};
|
||||
|
||||
using filesystem_path = common::model::path<fs_path_sep>;
|
||||
@@ -107,7 +111,7 @@ public:
|
||||
res /= name();
|
||||
|
||||
if (is_absolute_)
|
||||
res = "/" / res;
|
||||
res = fs_path_sep::value / res;
|
||||
else
|
||||
res = base / res;
|
||||
|
||||
|
||||
@@ -599,7 +599,7 @@ template <> struct convert<sequence_diagram> {
|
||||
|
||||
// Ensure relative_to has a value
|
||||
if (!rhs.relative_to.has_value)
|
||||
rhs.relative_to.set(std::filesystem::current_path());
|
||||
rhs.relative_to.set(std::filesystem::current_path().lexically_normal());
|
||||
|
||||
rhs.initialize_type_aliases();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user