Update of mhonarc/MHonArc/lib/MHonArc
Modified Files:
RFC822.pm
Log Message:
Bug #20142: Tokenize module does not translate quoted pairs
("\" CHAR) when tokenizing. For now, it will stay they way,
so mhonarc::extract_email_name() modified to unquote chars in
quoted-string or comment token.
Also, while examining tokenizer code, noticed bug in parsing
comments: quoted "\(" or "\)" not taken into account, which
could lead to improper tokenization. This has been fixed.
======================================================================
FILE: mhonarc/MHonArc/lib/MHonArc/RFC822.pm
<http://www.mhonarc.org/cgi-bin/viewcvs.cgi/*checkout*/mhonarc/MHonArc/lib/MHonArc/RFC822.pm?rev=1.4>
<http://www.mhonarc.org/cgi-bin/viewcvs.cgi/mhonarc/MHonArc/lib/MHonArc/RFC822.pm.diff?r1=1.3&r2=1.4&diff_format=h>
--- RFC822.pm 3 May 2009 19:37:20 -0000 1.3
+++ RFC822.pm 2 Jan 2011 08:42:32 -0000 1.4
@@ -156,12 +156,21 @@
# a comment.
do {
- s/^([^()]*([()]|$))//;
+ s/^(([^()]*)([()]|$))//;
$comment .= $1;
- $comment_depth++ if $2 eq '(';
- $comment_depth-- if $2 eq ')';
- do {
+ if ($3 eq '') {
# XXX error recovery for unterminated comment
- $comment_depth = 0;
- } if $2 eq '';
+ warn "Unterminated comment: $comment\n";
+ $comment_depth = 0;
+ } elsif (substr($2,-1,1) eq '\\') {
+ # quoted comment delim, ignore
+ } elsif ($3 eq '(') {
+ ++$comment_depth;
+ } elsif ($3 eq ')') {
+ --$comment_depth;
+ } else {
+ # Should not get here
+ warn "Internal error: expecting (' or ')' but got: $3\n";
+ $comment_depth = 0;
+ }
} until ($comment_depth == 0);
push (@outtoks, $comment);
---------------------------------------------------------------------
To sign-off this list, send email to majordomo(_at_)mhonarc(_dot_)org with the
message text UNSUBSCRIBE MHONARC-COMMITS