Summary: | quicksearch_history content partially written to stdout | ||||||
---|---|---|---|---|---|---|---|
Product: | Claws Mail (GTK 2) | Reporter: | Fabian Keil <fk> | ||||
Component: | Other | Assignee: | users | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | normal | CC: | claws-bugs-20218, pf, removed-gdpr, shlomif, slyich | ||||
Priority: | P3 | ||||||
Version: | 3.7.9 | ||||||
Hardware: | PC | ||||||
OS: | FreeBSD | ||||||
Attachments: |
|
Description
Fabian Keil
2011-04-25 14:06:18 UTC
That "ECHO;" line is not present on my generated matcher_parser_lex.c, so it's some problem with your lex/flex which may be generating the default rule for unmatched text (probably because of the empty user code section). Some ideas to try: a) If you build from git, in src/Makefile.am add "AM_LFLAGS = -s" above AM_YFLAGS line. You have to run toplevel autogen.sh then build. b) Remove last %% from matcher_parser_lex.l and try building. c) Instead removing last %%, add /* */ below it and try building. If nothing of the above works, which lex/flex version are you using? The FreeBSD/ElectroBSD port currently uses the generated file that is bundled in the upstream source tarball: $ tar xOf /usr/ports/distfiles/claws-mail-3.11.1.tar.xz claws-mail-3.11.1/src/matcher_parser_lex.c | cat -n | grep -3 "ECHO;" 1043 case 17: 1044 YY_RULE_SETUP 1045 #line 131 "matcher_parser_lex.l" 1046 ECHO; 1047 YY_BREAK 1048 #line 1049 "matcher_parser_lex.c" 1049 case YY_STATE_EOF(INITIAL): Thanks for the suggestions, I'll give them a try this weekend. Sorry, seems I was looking at the wrong place: I also have that "ECHO;" line in my generated .c file. I've also checked that a) works, though you probably have to either start from scratch or remove your current .c file. Anyway, the result is somewhat I don't like much: #line 131 "matcher_parser_lex.l" YY_FATAL_ERROR( "flex scanner jammed" ); A ECHO is harmless, but I suspect a fatal error is not what we want to replace it. Noticed stdout dumps as well. I noticed that generated lexer has a place to inject own ECHO handler with ECHO definition: /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) #endif Would it be reasonable to set it to no-op by claws-mail itself? Or perhaps extend a lexer to explicitly handle unexpected input? Created attachment 2174 [details]
Patch proposal not to display unmatched characters at lexer level
Anyone to try/comment the proposed patch? The patch looks good to me and seems to work as advertised. Thanks. Thanks, Fabian. |