Subject: | Net::Cmd::datasend doesn't escape dot in "\r","\n." (patch included) |
If datasend is first called with "\r" and then with "\n." it forgets to
escape the ".":
410 if ($last_ch eq "\015") {
411 $first_ch = "\012" if $line =~ s/^\012//;
412 }
413 elsif ($last_ch eq "\012") {
414 $first_ch = "." if $line =~ /^\./;
415 }
416
417 $line =~ s/\015?\012(\.?)/\015\012$1$1/sg;
From the first call $last_ch is "\015". Thus the line 411 sets $first_ch
to "\012" and strips the \012 from $line, which now starts with ".".
Line 417 does not escape the dot, because its no longer prefixed with \012.
Fix (tested):
@@ -408,7 +408,7 @@
my $first_ch = '';
if ($last_ch eq "\015") {
- $first_ch = "\012" if $line =~ s/^\012//;
+ $first_ch = "\012" if $line =~ s/^\012(\.?)/$1$1/;
}
elsif ($last_ch eq "\012") {
$first_ch = "." if $line =~ /^\./;