bug when editing filters or scoring rules is fixed
authorHoà Viêt Dinh <dinh.viet.hoa@free.fr>
Sun, 10 Nov 2002 16:10:53 +0000 (16:10 +0000)
committerHoà Viêt Dinh <dinh.viet.hoa@free.fr>
Sun, 10 Nov 2002 16:10:53 +0000 (16:10 +0000)
ChangeLog.claws
configure.in
src/matcher_parser_lex.l
src/matcher_parser_parse.y

index cc992967627663ac54e15a601a1623fbd5099ae6..413c00e48b5ebdebb3117ca1eb5c55fafb36ff71 100644 (file)
@@ -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
index 4013e62eeec4fa5c1dcccb50edfb43f683f50428..72092da6bd2c87cda4f1aa8321cf3ac56c344146 100644 (file)
@@ -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
index 8c33ee1b94af7df8c23e350b1a1df7ba3fe73bb8..624f9e25ddc356ee747038890cbf7bad2f0493d2 100644 (file)
@@ -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"
index 5ad0d39b63009c2f45988f2e2f93c09d1d27162c..1ca569e15699a3b962242e84af7a6b97e19d5607 100644 (file)
@@ -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;