summaryrefslogtreecommitdiffstats
path: root/third_party/sqlite/src/ext/fts2/fts2.c
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/sqlite/src/ext/fts2/fts2.c')
-rw-r--r--third_party/sqlite/src/ext/fts2/fts2.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/third_party/sqlite/src/ext/fts2/fts2.c b/third_party/sqlite/src/ext/fts2/fts2.c
index 5ec1265..ec4c108 100644
--- a/third_party/sqlite/src/ext/fts2/fts2.c
+++ b/third_party/sqlite/src/ext/fts2/fts2.c
@@ -320,6 +320,8 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <ctype.h>
+
#include "fts2.h"
#include "fts2_hash.h"
#include "fts2_tokenizer.h"
@@ -367,13 +369,13 @@ static int fts2Corrupt(void){
*/
/* TODO(shess) Is __isascii() a portable version of (c&0x80)==0? */
static int safe_isspace(char c){
- return c==' ' || c=='\t' || c=='\n' || c=='\r' || c=='\v' || c=='\f';
+ return (c&0x80)==0 ? isspace(c) : 0;
}
static int safe_tolower(char c){
- return (c>='A' && c<='Z') ? (c - 'A' + 'a') : c;
+ return (c>='A' && c<='Z') ? (c-'A'+'a') : c;
}
static int safe_isalnum(char c){
- return (c>='0' && c<='9') || (c>='A' && c<='Z') || (c>='a' && c<='z');
+ return (c&0x80)==0 ? isalnum(c) : 0;
}
typedef enum DocListType {