Navigation Menu

Skip to content

Commit

Permalink
Fix a bug that grn_dat_scan() fails for empty grn_dat
Browse files Browse the repository at this point in the history
GitHub: fix #273
  • Loading branch information
s-yata committed Jan 15, 2015
1 parent ae6b151 commit 78f5e1f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/dat.cpp
Expand Up @@ -683,7 +683,10 @@ grn_dat_scan(grn_ctx *ctx, grn_dat *dat, const char *str,

grn::dat::Trie * const trie = static_cast<grn::dat::Trie *>(dat->trie);
if (!trie) {
return -1;
if (str_rest) {
*str_rest = str + str_size;
}
return 0;
}

if (!max_num_scan_hits || !str_size) {
Expand Down

0 comments on commit 78f5e1f

Please sign in to comment.