Skip to content
Permalink
Browse files
Handle the case of a literal query of length 1.
  • Loading branch information
ggreer committed Feb 18, 2012
1 parent c8ed59b commit 01ce38f
Showing 1 changed file with 1 addition and 1 deletion.
@@ -12,7 +12,7 @@ void generate_skip_lookup(const char *find, size_t f_len, size_t skip_lookup[],
size_t i = 0;

for (i = 0; i < 256; i++) {
skip_lookup[i] = f_len - 1;
skip_lookup[i] = f_len - 1 || 1; /* Handle the case of f_len == 1 */
}

for (i = 0; i < f_len - 1; i++) {

0 comments on commit 01ce38f

Please sign in to comment.