Skip to content

Commit

Permalink
textsearch: ts_fsm: return error on request for case insensitive search
Browse files Browse the repository at this point in the history
For fsm text search, handle case insensitive parameter as -EINVAL.

Signed-off-by: Joonwoo Park <joonwpark81@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
joonwpark authored and davem330 committed Jul 8, 2008
1 parent 2523c3f commit 4313883
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/ts_fsm.c
Expand Up @@ -257,7 +257,7 @@ static unsigned int fsm_find(struct ts_config *conf, struct ts_state *state)
}

static struct ts_config *fsm_init(const void *pattern, unsigned int len,
gfp_t gfp_mask)
gfp_t gfp_mask, int flags)
{
int i, err = -EINVAL;
struct ts_config *conf;
Expand All @@ -269,6 +269,9 @@ static struct ts_config *fsm_init(const void *pattern, unsigned int len,
if (len % sizeof(struct ts_fsm_token) || ntokens < 1)
goto errout;

if (flags & TS_IGNORECASE)
goto errout;

for (i = 0; i < ntokens; i++) {
struct ts_fsm_token *t = &tokens[i];

Expand All @@ -284,6 +287,7 @@ static struct ts_config *fsm_init(const void *pattern, unsigned int len,
if (IS_ERR(conf))
return conf;

conf->flags = flags;
fsm = ts_config_priv(conf);
fsm->ntokens = ntokens;
memcpy(fsm->tokens, pattern, len);
Expand Down

0 comments on commit 4313883

Please sign in to comment.