Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1010)

Side by Side Diff: third_party/sqlite/ext/fts3/fts3_tokenizer1.c

Issue 186011: Merge 25141 - Fix issue 15261: Crash in history::TextDatabase::GetTextMatches... (Closed) Base URL: svn://chrome-svn/chrome/branches/195/src/
Patch Set: Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/sqlite/ext/fts3/fts3.c ('k') | third_party/sqlite/safe-tolower.patch » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:mergeinfo
Merged /branches/chrome_webkit_merge_branch/third_party/sqlite/ext/fts3/fts3_tokenizer1.c:r69-2775
Merged /trunk/src/third_party/sqlite/ext/fts3/fts3_tokenizer1.c:r25141
OLDNEW
1 /* 1 /*
2 ** 2006 Oct 10 2 ** 2006 Oct 10
3 ** 3 **
4 ** The author disclaims copyright to this source code. In place of 4 ** The author disclaims copyright to this source code. In place of
5 ** a legal notice, here is a blessing: 5 ** a legal notice, here is a blessing:
6 ** 6 **
7 ** May you do good and not evil. 7 ** May you do good and not evil.
8 ** May you find forgiveness for yourself and forgive others. 8 ** May you find forgiveness for yourself and forgive others.
9 ** May you share freely, never taking more than you give. 9 ** May you share freely, never taking more than you give.
10 ** 10 **
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 if( n>c->nTokenAllocated ){ 184 if( n>c->nTokenAllocated ){
185 c->nTokenAllocated = n+20; 185 c->nTokenAllocated = n+20;
186 c->pToken = sqlite3_realloc(c->pToken, c->nTokenAllocated); 186 c->pToken = sqlite3_realloc(c->pToken, c->nTokenAllocated);
187 if( c->pToken==NULL ) return SQLITE_NOMEM; 187 if( c->pToken==NULL ) return SQLITE_NOMEM;
188 } 188 }
189 for(i=0; i<n; i++){ 189 for(i=0; i<n; i++){
190 /* TODO(shess) This needs expansion to handle UTF-8 190 /* TODO(shess) This needs expansion to handle UTF-8
191 ** case-insensitivity. 191 ** case-insensitivity.
192 */ 192 */
193 unsigned char ch = p[iStartOffset+i]; 193 unsigned char ch = p[iStartOffset+i];
194 c->pToken[i] = ch<0x80 ? tolower(ch) : ch; 194 c->pToken[i] = (ch>='A' && ch<='Z') ? (ch-'A'+'a') : ch;
195 } 195 }
196 *ppToken = c->pToken; 196 *ppToken = c->pToken;
197 *pnBytes = n; 197 *pnBytes = n;
198 *piStartOffset = iStartOffset; 198 *piStartOffset = iStartOffset;
199 *piEndOffset = c->iOffset; 199 *piEndOffset = c->iOffset;
200 *piPosition = c->iToken++; 200 *piPosition = c->iToken++;
201 201
202 return SQLITE_OK; 202 return SQLITE_OK;
203 } 203 }
204 } 204 }
(...skipping 16 matching lines...) Expand all
221 ** Allocate a new simple tokenizer. Return a pointer to the new 221 ** Allocate a new simple tokenizer. Return a pointer to the new
222 ** tokenizer in *ppModule 222 ** tokenizer in *ppModule
223 */ 223 */
224 void sqlite3Fts3SimpleTokenizerModule( 224 void sqlite3Fts3SimpleTokenizerModule(
225 sqlite3_tokenizer_module const**ppModule 225 sqlite3_tokenizer_module const**ppModule
226 ){ 226 ){
227 *ppModule = &simpleTokenizerModule; 227 *ppModule = &simpleTokenizerModule;
228 } 228 }
229 229
230 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */ 230 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
OLDNEW
« no previous file with comments | « third_party/sqlite/ext/fts3/fts3.c ('k') | third_party/sqlite/safe-tolower.patch » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698