-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
lib/filterx: add startswith / endswith / includes functions #297
Conversation
899e102
to
6319d72
Compare
bcf682b
to
3da97bf
Compare
388c6ca
to
c6165b5
Compare
c6165b5
to
c87c606
Compare
c87c606
to
fd2a04d
Compare
lib/filterx/func-str.c
Outdated
if(self->str_len > G_MAXSSIZE) | ||
return FALSE; | ||
|
||
self->owned_str_value = g_utf8_casefold(self->borrowed_str_value, (gssize) self->str_len); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The official docs say for the deprecated strncasecmp
:
[...] There are therefore two replacement techniques:
g_ascii_strncasecmp(), which only works on ASCII and is not locale-sensitive,and g_utf8_casefold() followed by strcmp() on the resulting strings, which is good for case-insensitive sorting of UTF-8.
112b464
to
2b30d3b
Compare
2b30d3b
to
cdef386
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
There are a couple of things to resolve, then after another review round it will be probably merge ready :)
Sorry, there were some review comments stuck in from a previous session. Resolved everything that is already fixed. |
90c83b6
to
087a1ee
Compare
This will be used for startswith/endswith/includes functions Signed-off-by: Szilard Parrag <szilard.parrag@axoflow.com>
Signed-off-by: Szilard Parrag <szilard.parrag@axoflow.com>
Signed-off-by: Szilard Parrag <szilard.parrag@axoflow.com>
Signed-off-by: Szilard Parrag <szilard.parrag@axoflow.com>
Signed-off-by: Szilard Parrag <szilard.parrag@axoflow.com>
Signed-off-by: Szilard Parrag <szilard.parrag@axoflow.com>
087a1ee
to
6f663ae
Compare
Init time optimized version of #277.
I opted for closing that because the changes are really different.