Commit a88c6f3d by Maarten L. Hekkelman

Fix for older clang (on MacOS?).

parent ed6c6f00
...@@ -378,9 +378,10 @@ const Validator &ValidatorFactory::operator[](std::string_view dictionary) ...@@ -378,9 +378,10 @@ const Validator &ValidatorFactory::operator[](std::string_view dictionary)
// not found, add it // not found, add it
fs::path dict_name(dictionary); // too bad clang version 10 did not have a constructor for fs::path that accepts a std::string_view
fs::path dict_name(dictionary.data(), dictionary.data() + dictionary.length());
auto data = loadResource(dictionary); auto data = loadResource(dict_name);
if (not data and dict_name.extension().string() != ".dic") if (not data and dict_name.extension().string() != ".dic")
data = loadResource(dict_name.parent_path() / (dict_name.filename().string() + ".dic")); data = loadResource(dict_name.parent_path() / (dict_name.filename().string() + ".dic"));
...@@ -392,7 +393,7 @@ const Validator &ValidatorFactory::operator[](std::string_view dictionary) ...@@ -392,7 +393,7 @@ const Validator &ValidatorFactory::operator[](std::string_view dictionary)
std::error_code ec; std::error_code ec;
// might be a compressed dictionary on disk // might be a compressed dictionary on disk
fs::path p = dictionary; fs::path p = dict_name;
if (p.extension() == ".dic") if (p.extension() == ".dic")
p = p.parent_path() / (p.filename().string() + ".gz"); p = p.parent_path() / (p.filename().string() + ".gz");
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment