Subject: | [PATCH] 2 bug fixes for proc2ma |
Hello,
I just tried out "proc2ma". It produced a script which wouldn't even
compile. There were at least a couple easy bugs in it, wich the below
patch addresses.
1. The ENV conversionn lines lacked a trailing semicolon
2. Some header() calls were being generated like this:
$item->$item->header .. instead of just "$item->header()".
Also, Any chance of a new release any time soon? It's been over a year
since the last one, including significant bug reports, including the
"improper From handling" bug, and the "insecure use of /tmp" bug.
It would be ideal of proc2ma could at least have a simple test script to
verify that it can produce output that will compile.
Mark
####
--- /usr/local/bin/proc2ma Mon Apr 21 14:17:04 2003
+++ bin/proc2ma Sat Jul 19 13:07:27 2003
@@ -1,4 +1,4 @@
-#! /usr/local/bin/perl
+#! /usr/bin/env perl
my @grammar;
my (%flags, $return);
@@ -16,7 +16,7 @@
{ my $from=$1;
my $what;
($what = $2) =~ s/\$(\w+)/\$ENV{$1}/g;
- $return = "\$ENV{$from}=qq($what)"; }
+ $return = "\$ENV{$from}=qq($what);"; }
filename : /\w+/
recipe : { %main::flags = undef; } <reject>
recipe : ':0' flag(?) locallock(?) "\n" condition(s) action "\n"
@@ -69,7 +69,7 @@
my ($type, $pat) = @_;
my $match;
my $func;
- if ($flags{H} or !$flags{B}) { $func = "\$item->header" } else {
$func = "join ('', \$item->body)"; }
+ if ($flags{H} or !$flags{B}) { $func = "header" } else { $func =
"join ('', \$item->body)"; }
if ($type eq "<" or $type eq ">") {
return $return = "length(\$item->$func()) $type $pat";
}