Navigation Menu

Skip to content

Commit

Permalink
Fix a bug that wrong flag name is parsed
Browse files Browse the repository at this point in the history
For example, `--query_flags ALLOW_PRAGMAxALLOW_COLUMN` can be parsed as
`ALLOW_PRAGMA|ALLOW_COLUMN`. `x` is just skipped.
  • Loading branch information
kou committed Jan 21, 2015
1 parent 8375847 commit 50feaec
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/proc.c
Expand Up @@ -396,7 +396,7 @@ grn_parse_query_flags(grn_ctx *ctx, const char *query_flags,
if (((query_flags_end - query_flags) >= (sizeof(#name) - 1)) &&\
(!memcmp(query_flags, #name, sizeof(#name) - 1))) {\
flags |= GRN_EXPR_ ## name;\
query_flags += sizeof(#name);\
query_flags += sizeof(#name) - 1;\
continue;\
}

Expand Down Expand Up @@ -607,7 +607,7 @@ grn_parse_table_group_calc_types(grn_ctx *ctx,
if (((calc_types_end - calc_types) >= (sizeof(#name) - 1)) &&\
(!memcmp(calc_types, #name, sizeof(#name) - 1))) {\
flags |= GRN_TABLE_GROUP_CALC_ ## name;\
calc_types += sizeof(#name);\
calc_types += sizeof(#name) - 1;\
continue;\
}

Expand Down Expand Up @@ -3540,7 +3540,7 @@ parse_normalize_flags(grn_ctx *ctx, grn_obj *flag_names)
if (((names_end - names) >= (sizeof(#name) - 1)) &&\
(!memcmp(names, #name, sizeof(#name) - 1))) {\
flags |= GRN_STRING_ ## name;\
names += sizeof(#name);\
names += sizeof(#name) - 1;\
continue;\
}

Expand Down Expand Up @@ -3753,7 +3753,7 @@ parse_tokenize_flags(grn_ctx *ctx, grn_obj *flag_names)
if (((names_end - names) >= (sizeof(#name) - 1)) &&\
(!memcmp(names, #name, sizeof(#name) - 1))) {\
flags |= GRN_TOKEN_CURSOR_ ## name;\
names += sizeof(#name);\
names += sizeof(#name) - 1;\
continue;\
}

Expand Down

0 comments on commit 50feaec

Please sign in to comment.