fix unbalanced " problem in rules

This commit is contained in:
Colin Leroy 2002-11-13 14:47:33 +00:00
parent 51faf3c248
commit 2317dfe6e6
3 changed files with 30 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2002-11-13 [colin] 0.8.5claws142
* src/matcher_parser_parse.y
Fix rule problem when " don't match
2002-11-13 [christoph] 0.8.5claws141
* src/folder.c

View file

@ -11,7 +11,7 @@ MINOR_VERSION=8
MICRO_VERSION=5
INTERFACE_AGE=0
BINARY_AGE=0
EXTRA_VERSION=claws141
EXTRA_VERSION=claws142
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
dnl set $target

View file

@ -81,10 +81,34 @@ ScoringProp * matcher_parser_get_scoring(gchar * str)
return scoring;
}
static gboolean check_quote_symetry (gchar *str)
{
gchar *walk;
int ret = 0;
if (str == NULL)
return TRUE; /* heh, that's symetric */
if (*str == '\0')
return TRUE;
for (walk = str; *walk; walk++) {
if (*walk == '\"') {
if (walk == str /* first char */
|| *(walk - 1) != '\\') /* not escaped */
ret ++;
}
}
return !(ret%2);
}
MatcherList * matcher_parser_get_cond(gchar * str)
{
void * bufstate;
if (!check_quote_symetry(str)) {
cond = NULL;
return cond;
}
/* bad coding to enable the sub-grammar matching
in yacc */
matcher_parserlineno = 1;