diff options
author | dan <dan@noemail.net> | 2015-01-27 19:01:26 +0000 |
---|---|---|
committer | dan <dan@noemail.net> | 2015-01-27 19:01:26 +0000 |
commit | 6f0138e89ecaac3561fbfa297417adbe0a49798d (patch) | |
tree | 44cbd7d06e8faf3108a5d5d21f76f40651d5cd63 /ext/fts3/fts3_snippet.c | |
parent | 18f6ff9eb7db02356102283c28053b0a602f55d7 (diff) | |
download | sqlite-6f0138e89ecaac3561fbfa297417adbe0a49798d.tar.gz sqlite-6f0138e89ecaac3561fbfa297417adbe0a49798d.zip |
Fix a bug in the fts3 snippet() function causing it to omit leading separator characters from snippets that begin with the first token in a column.
FossilOrigin-Name: adc9283dd9bc3a6463f8c4fe23dd58a3712c349d
Diffstat (limited to 'ext/fts3/fts3_snippet.c')
-rw-r--r-- | ext/fts3/fts3_snippet.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ext/fts3/fts3_snippet.c b/ext/fts3/fts3_snippet.c index 93ee86f6a..e40750502 100644 --- a/ext/fts3/fts3_snippet.c +++ b/ext/fts3/fts3_snippet.c @@ -682,8 +682,12 @@ static int fts3SnippetText( ** required. They are required if (a) this is not the first fragment, ** or (b) this fragment does not begin at position 0 of its column. */ - if( rc==SQLITE_OK && (iPos>0 || iFragment>0) ){ - rc = fts3StringAppend(pOut, zEllipsis, -1); + if( rc==SQLITE_OK ){ + if( iPos>0 || iFragment>0 ){ + rc = fts3StringAppend(pOut, zEllipsis, -1); + }else if( iBegin ){ + rc = fts3StringAppend(pOut, zDoc, iBegin); + } } if( rc!=SQLITE_OK || iCurrent<iPos ) continue; } |