diff options
author | drh <drh@noemail.net> | 2014-10-31 14:53:32 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2014-10-31 14:53:32 +0000 |
commit | ca3e10ea37c4808fa84063f06b02229801b28cc0 (patch) | |
tree | 25f7d9b2ab4ff71311882bcee951b6e9ab1cb62f /src/util.c | |
parent | bc2866ca7abc2ad7cbb6878d65cd18e584cff8f5 (diff) | |
parent | 0fb5daed34ba6f16d761b8ad02b944ec59cf5c03 (diff) | |
download | sqlite-ca3e10ea37c4808fa84063f06b02229801b28cc0.tar.gz sqlite-ca3e10ea37c4808fa84063f06b02229801b28cc0.zip |
Merge recent trunk enhancements, and in particular the improvements to
the b-tree balancing logic, into the sessions branch.
FossilOrigin-Name: 28b044a51215a3f64dafb2cf3b6cb7d2029580ef
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c index 9bb8d8915..ab409fa25 100644 --- a/src/util.c +++ b/src/util.c @@ -251,6 +251,11 @@ int sqlite3Dequote(char *z){ */ int sqlite3_stricmp(const char *zLeft, const char *zRight){ register unsigned char *a, *b; + if( zLeft==0 ){ + return zRight ? -1 : 0; + }else if( zRight==0 ){ + return 1; + } a = (unsigned char *)zLeft; b = (unsigned char *)zRight; while( *a!=0 && UpperToLower[*a]==UpperToLower[*b]){ a++; b++; } @@ -258,6 +263,11 @@ int sqlite3_stricmp(const char *zLeft, const char *zRight){ } int sqlite3_strnicmp(const char *zLeft, const char *zRight, int N){ register unsigned char *a, *b; + if( zLeft==0 ){ + return zRight ? -1 : 0; + }else if( zRight==0 ){ + return 1; + } a = (unsigned char *)zLeft; b = (unsigned char *)zRight; while( N-- > 0 && *a!=0 && UpperToLower[*a]==UpperToLower[*b]){ a++; b++; } |