[Groonga-commit] groonga/groonga at f3bc40e [master] token_filters/stem: cast the argument of is* from char to unsigned char

Back to archive index

Susumu Yata null+****@clear*****
Tue Jul 18 16:10:00 JST 2017


Susumu Yata	2017-07-18 16:10:00 +0900 (Tue, 18 Jul 2017)

  New Revision: f3bc40e9484df5b50c8b976f60bc7054405445cf
  https://github.com/groonga/groonga/commit/f3bc40e9484df5b50c8b976f60bc7054405445cf

  Message:
    token_filters/stem: cast the argument of is* from char to unsigned char
    
    GitHub: #742

  Modified files:
    plugins/token_filters/stem.c

  Modified: plugins/token_filters/stem.c (+5 -5)
===================================================================
--- plugins/token_filters/stem.c    2017-07-17 21:37:15 +0900 (63e640d)
+++ plugins/token_filters/stem.c    2017-07-18 16:10:00 +0900 (0b6720c)
@@ -92,15 +92,15 @@ is_stemmable(grn_obj *data, grn_bool *is_all_upper)
   end = current + GRN_TEXT_LEN(data);
 
   for (; current < end; current++) {
-    if (islower(*current)) {
+    if (islower((unsigned char)*current)) {
       have_lower = GRN_TRUE;
       continue;
     }
-    if (isupper(*current)) {
+    if (isupper((unsigned char)*current)) {
       have_upper = GRN_TRUE;
       continue;
     }
-    if (isdigit(*current)) {
+    if (isdigit((unsigned char)*current)) {
       continue;
     }
     switch (*current) {
@@ -131,7 +131,7 @@ normalize(grn_ctx *ctx,
   end = current + length;
 
   for (; current < end; current++) {
-    if (isupper(*current)) {
+    if (isupper((unsigned char)*current)) {
       if (current > unwritten) {
         GRN_TEXT_PUT(ctx, normalized, unwritten, current - unwritten);
       }
@@ -157,7 +157,7 @@ unnormalize(grn_ctx *ctx,
   end = current + length;
 
   for (; current < end; current++) {
-    if (islower(*current)) {
+    if (islower((unsigned char)*current)) {
       if (current > unwritten) {
         GRN_TEXT_PUT(ctx, normalized, unwritten, current - unwritten);
       }
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index