Closed rurban closed 1 year ago
Please merge, this fixes a large number of failing tests.
static int matchcharclass(char c, const char* str)
{
do
{
if (matchrange(c, str))
{
return 1;
}
else if (str[0] == '\\')
{
/* Escape-char: increment str-ptr and match on next char */
str += 1;
if (matchmetachar(c, str))
{
return 1;
}
else if ((c == str[0]) && !ismetachar(c))
{
return 1;
}
}
else if (c == str[0])
{
if (c == '-')
{
if ((str[-1] == '\0') || (str[1] == '\0')) return 1; else continue;
}
else
{
return 1;
}
}
}
while (*str++ != '\0');
return 0;
}
fix ranges with ending -
Fixes GH #79 and the exreg failures with [1-5-]+[-1-2]-[-]