summaryrefslogtreecommitdiff
path: root/lib/ts_fsm.c
diff options
context:
space:
mode:
authorJoonwoo Park <joonwpark81@gmail.com>2008-07-08 02:38:27 -0700
committerDavid S. Miller <davem@davemloft.net>2008-07-08 02:38:27 -0700
commit43138833ee9af07e865a4dcbfe81684c9c2f2262 (patch)
treec3de1d509fce8c2defbf4d63d2e3055de24e9948 /lib/ts_fsm.c
parent2523c3fc2bc9e34c06a71517844d55353f1f904a (diff)
downloadlinux-3.10-43138833ee9af07e865a4dcbfe81684c9c2f2262.tar.gz
linux-3.10-43138833ee9af07e865a4dcbfe81684c9c2f2262.tar.bz2
linux-3.10-43138833ee9af07e865a4dcbfe81684c9c2f2262.zip
textsearch: ts_fsm: return error on request for case insensitive search
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>
Diffstat (limited to 'lib/ts_fsm.c')
-rw-r--r--lib/ts_fsm.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/ts_fsm.c b/lib/ts_fsm.c
index af575b61526..5696a35184e 100644
--- a/lib/ts_fsm.c
+++ b/lib/ts_fsm.c
@@ -257,7 +257,7 @@ found_match:
}
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;
@@ -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];
@@ -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);