Project

General

Profile

Bug #15816 ยป casecmp-lowercase.patch

jeremyevans0 (Jeremy Evans), 05/09/2019 03:37 AM

View differences:

string.c
3367 3367
    if (single_byte_optimizable(str1) && single_byte_optimizable(str2)) {
3368 3368
	while (p1 < p1end && p2 < p2end) {
3369 3369
	    if (*p1 != *p2) {
3370
		unsigned int c1 = TOUPPER(*p1 & 0xff);
3371
		unsigned int c2 = TOUPPER(*p2 & 0xff);
3370
		unsigned int c1 = TOLOWER(*p1 & 0xff);
3371
		unsigned int c2 = TOLOWER(*p2 & 0xff);
3372 3372
                if (c1 != c2)
3373 3373
                    return INT2FIX(c1 < c2 ? -1 : 1);
3374 3374
	    }
......
3382 3382
            int l2, c2 = rb_enc_ascget(p2, p2end, &l2, enc);
3383 3383

  
3384 3384
            if (0 <= c1 && 0 <= c2) {
3385
                c1 = TOUPPER(c1);
3386
                c2 = TOUPPER(c2);
3385
                c1 = TOLOWER(c1);
3386
                c2 = TOLOWER(c2);
3387 3387
                if (c1 != c2)
3388 3388
                    return INT2FIX(c1 < c2 ? -1 : 1);
3389 3389
            }
3390
-