diff options
Diffstat (limited to 'strings/ctype-mb.c')
-rw-r--r-- | strings/ctype-mb.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/strings/ctype-mb.c b/strings/ctype-mb.c index e902730d65a..a9edb35d8a4 100644 --- a/strings/ctype-mb.c +++ b/strings/ctype-mb.c @@ -399,7 +399,7 @@ static int my_strnncollsp_mb_bin(CHARSET_INFO * cs __attribute__((unused)), res= 0; if (a_length != b_length) { - int swap= 0; + int swap= 1; if (diff_if_only_endspace_difference) res= 1; /* Assume 'a' is bigger */ /* @@ -417,7 +417,7 @@ static int my_strnncollsp_mb_bin(CHARSET_INFO * cs __attribute__((unused)), for (end= a + a_length-length; a < end ; a++) { if (*a != ' ') - return ((int) *a - (int) ' ') ^ swap; + return (*a < ' ') ? -swap : swap; } } return res; |