inline-comment: bugfixes.
Fixes following bugs: 1. In whitespace-must-follow mode a comment sequence immediately followed by a newline caused the next line to be treated as a comment. Thus the following input: ; text produced empty output (see test icmt-dec-08). 2. Line number information was not emitted before lines starting with a comment sequence substring, e.g.: ; comment ;valid line See test icmt-dec-09. * libmailutils/filter/inline-comment.c (ilcmt_state) Withdraw ilcmt_rollback_com state, use ilcmt_rollback instead. Withdraw ilcmt_newline_ac state, use ILCMT_EMIT_LINE_INFO flag instead. (ILCMT_EMIT_LINE_INFO): New flag. (ilcmt_data) <replay>: Remove. <rollback_buffer, rollback_size> <rollback_index>: New members. (init_rollback): New function. (_ilcmt_decoder): Use ilcmt_rollback state. <ilcmt_comment_ws>: Do not skip newline following the comment. Emit line info before rolling back, if required. (_ilcmt_encoder): Use ilcmt_rollback state. * libmailutils/tests/inline-comment.at: Rename tests. Add tests for newline after a comment (icmt-dec-08) and line info with whitespace-follow mode (icmt-dec-09).
Showing
2 changed files
with
98 additions
and
58 deletions
-
Please register or sign in to post a comment