fpath = std::filesystem::canonical(fpath, ec);
- if (!ec) {
+ if (!ec && ec.value() != 0) {
msg_err_hyperscan("invalid path: \"%s\", error message: %s", fname, ec.message().c_str());
return;
}
- if (fpath.empty()) {
- msg_err_hyperscan("attempt to add an empty hyperscan file!");
- return;
- }
-
- if (!std::filesystem::exists(fpath)) {
- msg_err_hyperscan("attempt to add non existing hyperscan file: %s, %s", fpath.c_str(),
- strerror(errno));
- return;
- }
-
auto dir = fpath.parent_path();
auto ext = fpath.extension();
fpath = std::filesystem::canonical(fpath, ec);
- if (!ec) {
+ if (!ec && ec.value() != 0) {
msg_err_hyperscan("invalid path to remove: \"%s\", error message: %s",
fname, ec.message().c_str());
return;