Skip to content

Commit

Permalink
char_type/2 fix upper/lower, re issue #387
Browse files Browse the repository at this point in the history
  • Loading branch information
infradig committed Nov 9, 2023
1 parent 017d3fe commit d3ea04c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/predicates.c
Original file line number Diff line number Diff line change
Expand Up @@ -5837,19 +5837,19 @@ static bool fn_char_type_2(query *q)
return iswblank(ch);
else if (!CMP_STRING_TO_CSTR(q, p2, "space"))
return iswspace(ch);
else if (!CMP_STRING_TO_CSTR(q, p2, "lower"))
return iswlower(ch);
else if (!CMP_STRING_TO_CSTR(q, p2, "upper"))
return iswupper(ch);
else if (!CMP_STRING_TO_CSTR(q, p2, "to_lower") && p2->arity) {
//else if (!CMP_STRING_TO_CSTR(q, p2, "lower"))
// return iswlower(ch);
//else if (!CMP_STRING_TO_CSTR(q, p2, "upper"))
// return iswupper(ch);
else if (!CMP_STRING_TO_CSTR(q, p2, "lower") && p2->arity) {
cell *arg1 = deref(q, p2+1, p2_ctx);
pl_idx arg1_ctx = q->latest_ctx;
char tmpbuf[20];
sprintf(tmpbuf, "%c", tolower(ch));
cell tmp;
make_string(&tmp, tmpbuf);
return unify(q, arg1, arg1_ctx, &tmp, q->st.curr_frame);
} else if (!CMP_STRING_TO_CSTR(q, p2, "to_upper") && p2->arity) {
} else if (!CMP_STRING_TO_CSTR(q, p2, "upper") && p2->arity) {
cell *arg1 = deref(q, p2+1, p2_ctx);
pl_idx arg1_ctx = q->latest_ctx;
char tmpbuf[20];
Expand Down

0 comments on commit d3ea04c

Please sign in to comment.