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].

drh 2011-06-29 11:20 UTC trunk
Commit f23e90da8ac8a5ab59e8c246ea53645a39b3bbf8
1 file changed +1 -1
+1 -1
--- src/printf.c
+++ src/printf.c
@@ -859,11 +859,11 @@
859859
int a, b;
860860
do{
861861
a = *zA++;
862862
b = *zB++;
863863
}while( a==b && a!=0 );
864
- return a - b;
864
+ return ((unsigned char)a) - (unsigned char)b;
865865
}
866866
}
867867
868868
/*
869869
** Case insensitive string comparison.
870870
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button