Deal with xinclude == xmlbase

It's a silly edge case as you can't xinclude directories, but might as well
make it a little more sane.
This commit is contained in:
Daniel James
2017-10-04 02:45:01 +01:00
parent c5b8ad6d38
commit e0ec41683d
18 changed files with 57 additions and 7 deletions

View File

@@ -51,7 +51,7 @@ namespace quickbook
}
// The relative path from base to path
fs::path path_difference(fs::path const& base, fs::path const& path)
fs::path path_difference(fs::path const& base, fs::path const& path, bool is_file)
{
fs::path
absolute_base = fs::absolute(base),
@@ -97,7 +97,10 @@ namespace quickbook
}
}
if (base_it == base_end && path_it == path_end) {
if (is_file && path_it == path_end && path_it != path_parts.begin()) {
--path_it;
result = "..";
} else if (base_it == base_end && path_it == path_end) {
result = ".";
}