refactor: watchdir (#3606)

This commit is contained in:
Charles Kerr
2022-08-10 08:34:51 -05:00
committed by GitHub
parent b1cc968969
commit c66303fae2
21 changed files with 1063 additions and 1396 deletions

View File

@@ -36,7 +36,6 @@
#define UTF_CPP_CPLUSPLUS 201703L
#include <utf8.h>
#include <event2/buffer.h>
#include <event2/event.h>
#include <fmt/format.h>
@@ -306,29 +305,6 @@ std::string_view tr_strvStrip(std::string_view str)
return str;
}
bool tr_str_has_suffix(char const* str, char const* suffix)
{
if (str == nullptr)
{
return false;
}
if (suffix == nullptr)
{
return true;
}
auto const str_len = strlen(str);
auto const suffix_len = strlen(suffix);
if (str_len < suffix_len)
{
return false;
}
return evutil_ascii_strncasecmp(str + str_len - suffix_len, suffix, suffix_len) == 0;
}
/****
*****
****/