Skip to content

Commit

Permalink
char_type/2 fix octal_digit, re issue #387
Browse files Browse the repository at this point in the history
  • Loading branch information
infradig committed Nov 9, 2023
1 parent 3fdc738 commit 017d3fe
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/predicates.c
Original file line number Diff line number Diff line change
Expand Up @@ -5811,15 +5811,22 @@ static bool fn_char_type_2(query *q)
return iswalpha(ch);
else if (!CMP_STRING_TO_CSTR(q, p2, "alphabetic"))
return iswalpha(ch);
else if (!CMP_STRING_TO_CSTR(q, p2, "alnum"))
return iswalpha(ch) || iswdigit(ch);
else if (!CMP_STRING_TO_CSTR(q, p2, "alphanumeric"))
return iswalpha(ch) || iswdigit(ch);
else if (!CMP_STRING_TO_CSTR(q, p2, "prolog"))
return iswalpha(ch) || iswdigit(ch) || iswgraph(ch);
else if (!CMP_STRING_TO_CSTR(q, p2, "hexadecimal_digit")) {
static const char *s_hex = "0123456789abcdefABCDEF";
return strchr(s_hex, ch);
} else if (!CMP_STRING_TO_CSTR(q, p2, "octal_digit")) {
static const char *s_hex = "01234567";
return strchr(s_hex, ch);
} else if (!CMP_STRING_TO_CSTR(q, p2, "decimal_digit"))
return iswdigit(ch);
else if (!CMP_STRING_TO_CSTR(q, p2, "numeric"))
return iswdigit(ch);
else if (!CMP_STRING_TO_CSTR(q, p2, "digit"))
return iswdigit(ch);
else if (!CMP_STRING_TO_CSTR(q, p2, "xdigit"))
Expand Down

0 comments on commit 017d3fe

Please sign in to comment.