diff options
author | drh <drh@noemail.net> | 2016-03-16 01:16:30 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2016-03-16 01:16:30 +0000 |
commit | 47e1842e5bd5c5f467b0290f3fde9df69fa42a25 (patch) | |
tree | 69786029a35258e2ee2a76f5d023764e19a074f0 /ext/misc/spellfix.c | |
parent | c5c67abb9ab2c58d41f75a41a1693e4b30e00bd5 (diff) | |
parent | 32f57d4c373c8f49b59f4a40149c136ef8a5632b (diff) | |
download | sqlite-47e1842e5bd5c5f467b0290f3fde9df69fa42a25.tar.gz sqlite-47e1842e5bd5c5f467b0290f3fde9df69fa42a25.zip |
Merge all recent enhancements from trunk.
FossilOrigin-Name: 6a7ee04b0ddac36a87d5ed2ac89a53e537f4d5a3
Diffstat (limited to 'ext/misc/spellfix.c')
-rw-r--r-- | ext/misc/spellfix.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ext/misc/spellfix.c b/ext/misc/spellfix.c index 5734d04f4..b5859ea2c 100644 --- a/ext/misc/spellfix.c +++ b/ext/misc/spellfix.c @@ -1734,6 +1734,7 @@ static void scriptCodeSqlFunc( int c, sz; int scriptMask = 0; int res; + int seenDigit = 0; # define SCRIPT_LATIN 0x0001 # define SCRIPT_CYRILLIC 0x0002 # define SCRIPT_GREEK 0x0004 @@ -1744,8 +1745,12 @@ static void scriptCodeSqlFunc( c = utf8Read(zIn, nIn, &sz); zIn += sz; nIn -= sz; - if( c<0x02af && (c>=0x80 || midClass[c&0x7f]<CCLASS_DIGIT) ){ - scriptMask |= SCRIPT_LATIN; + if( c<0x02af ){ + if( c>=0x80 || midClass[c&0x7f]<CCLASS_DIGIT ){ + scriptMask |= SCRIPT_LATIN; + }else if( c>='0' && c<='9' ){ + seenDigit = 1; + } }else if( c>=0x0400 && c<=0x04ff ){ scriptMask |= SCRIPT_CYRILLIC; }else if( c>=0x0386 && c<=0x03ce ){ @@ -1756,6 +1761,7 @@ static void scriptCodeSqlFunc( scriptMask |= SCRIPT_ARABIC; } } + if( scriptMask==0 && seenDigit ) scriptMask = SCRIPT_LATIN; switch( scriptMask ){ case 0: res = 999; break; case SCRIPT_LATIN: res = 215; break; |