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_);
|
auto pp = p.fs_path(root_);
|
||||||
for (const auto &path : paths_) {
|
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 true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -37,7 +37,11 @@ namespace clanguml::common::model {
|
|||||||
enum class source_file_t { kDirectory, kHeader, kImplementation };
|
enum class source_file_t { kDirectory, kHeader, kImplementation };
|
||||||
|
|
||||||
struct fs_path_sep {
|
struct fs_path_sep {
|
||||||
|
#ifdef _WIN32
|
||||||
|
static constexpr std::string_view value = "\\";
|
||||||
|
#else
|
||||||
static constexpr std::string_view value = "/";
|
static constexpr std::string_view value = "/";
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
using filesystem_path = common::model::path<fs_path_sep>;
|
using filesystem_path = common::model::path<fs_path_sep>;
|
||||||
@@ -107,7 +111,7 @@ public:
|
|||||||
res /= name();
|
res /= name();
|
||||||
|
|
||||||
if (is_absolute_)
|
if (is_absolute_)
|
||||||
res = "/" / res;
|
res = fs_path_sep::value / res;
|
||||||
else
|
else
|
||||||
res = base / res;
|
res = base / res;
|
||||||
|
|
||||||
|
|||||||
@@ -599,7 +599,7 @@ template <> struct convert<sequence_diagram> {
|
|||||||
|
|
||||||
// Ensure relative_to has a value
|
// Ensure relative_to has a value
|
||||||
if (!rhs.relative_to.has_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();
|
rhs.initialize_type_aliases();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user