Fossil SCM
Fix the fossil_strcmp() routine so that it compares strings in the correct order even if some of the characters have their high-order bits set. Ticket [5982aa506467d].
Commit
f23e90da8ac8a5ab59e8c246ea53645a39b3bbf8
Parent
5392b5c28b1ac14…
1 file changed
+1
-1
+1
-1
| --- src/printf.c | ||
| +++ src/printf.c | ||
| @@ -859,11 +859,11 @@ | ||
| 859 | 859 | int a, b; |
| 860 | 860 | do{ |
| 861 | 861 | a = *zA++; |
| 862 | 862 | b = *zB++; |
| 863 | 863 | }while( a==b && a!=0 ); |
| 864 | - return a - b; | |
| 864 | + return ((unsigned char)a) - (unsigned char)b; | |
| 865 | 865 | } |
| 866 | 866 | } |
| 867 | 867 | |
| 868 | 868 | /* |
| 869 | 869 | ** Case insensitive string comparison. |
| 870 | 870 |
| --- src/printf.c | |
| +++ src/printf.c | |
| @@ -859,11 +859,11 @@ | |
| 859 | int a, b; |
| 860 | do{ |
| 861 | a = *zA++; |
| 862 | b = *zB++; |
| 863 | }while( a==b && a!=0 ); |
| 864 | return a - b; |
| 865 | } |
| 866 | } |
| 867 | |
| 868 | /* |
| 869 | ** Case insensitive string comparison. |
| 870 |
| --- src/printf.c | |
| +++ src/printf.c | |
| @@ -859,11 +859,11 @@ | |
| 859 | int a, b; |
| 860 | do{ |
| 861 | a = *zA++; |
| 862 | b = *zB++; |
| 863 | }while( a==b && a!=0 ); |
| 864 | return ((unsigned char)a) - (unsigned char)b; |
| 865 | } |
| 866 | } |
| 867 | |
| 868 | /* |
| 869 | ** Case insensitive string comparison. |
| 870 |