From 3d8871c322b2a7146c50eb453e29ce0b137c7bca Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ho=C3=A0=20Vi=C3=AAt=20Dinh?= Date: Sun, 10 Nov 2002 16:10:53 +0000 Subject: [PATCH] bug when editing filters or scoring rules is fixed --- ChangeLog.claws | 8 ++++++++ configure.in | 2 +- src/matcher_parser_lex.l | 8 ++++++++ src/matcher_parser_parse.y | 8 ++++++++ 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/ChangeLog.claws b/ChangeLog.claws index cc9929676..413c00e48 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -1,3 +1,11 @@ +2002-11-10 [hoa] 0.8.5claws115 + + * src/matcher_parser_lex.l + * src/matcher_parser_parse.y + config file for scoring and filtering is no more trashed + when there is a syntax error in a filtering rule when + editing it in a dialog. + 2002-11-09 [colin] 0.8.5claws114 * src/mbox_folder.c diff --git a/configure.in b/configure.in index 4013e62ee..72092da6b 100644 --- a/configure.in +++ b/configure.in @@ -11,7 +11,7 @@ MINOR_VERSION=8 MICRO_VERSION=5 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=claws114 +EXTRA_VERSION=claws115 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION dnl set $target diff --git a/src/matcher_parser_lex.l b/src/matcher_parser_lex.l index 8c33ee1b9..624f9e25d 100644 --- a/src/matcher_parser_lex.l +++ b/src/matcher_parser_lex.l @@ -15,6 +15,14 @@ static void add_char(char ch) if (string_buf_ptr - string_buf < sizeof(string_buf)) *string_buf_ptr++ = ch; } + + +/* this function will reinitializes the parser */ + +void matcher_parser_init(void) +{ + BEGIN(0); +} %} %option prefix="matcher_parser" diff --git a/src/matcher_parser_parse.y b/src/matcher_parser_parse.y index 5ad0d39b6..1ca569e15 100644 --- a/src/matcher_parser_parse.y +++ b/src/matcher_parser_parse.y @@ -51,7 +51,10 @@ FilteringProp * matcher_parser_get_filtering(gchar * str) in yacc */ matcher_parserlineno = 1; matcher_parser_dialog = 1; + matcher_parserrestart(NULL); + matcher_parser_init(); bufstate = matcher_parser_scan_string(str); + matcher_parser_switch_to_buffer(bufstate); if (matcher_parserparse() != 0) filtering = NULL; matcher_parser_dialog = 0; @@ -67,7 +70,10 @@ ScoringProp * matcher_parser_get_scoring(gchar * str) in yacc */ matcher_parserlineno = 1; matcher_parser_dialog = 1; + matcher_parserrestart(NULL); + matcher_parser_init(); bufstate = matcher_parser_scan_string(str); + matcher_parser_switch_to_buffer(bufstate); if (matcher_parserparse() != 0) scoring = NULL; matcher_parser_dialog = 0; @@ -83,6 +89,8 @@ MatcherList * matcher_parser_get_cond(gchar * str) in yacc */ matcher_parserlineno = 1; matcher_parser_dialog = 1; + matcher_parserrestart(NULL); + matcher_parser_init(); bufstate = matcher_parser_scan_string(str); matcher_parserparse(); matcher_parser_dialog = 0; -- 2.25.1