70 lines
1.8 KiB
Plaintext
70 lines
1.8 KiB
Plaintext
$NetBSD: patch-an,v 1.3 2011/10/28 06:16:12 spz Exp $
|
|
|
|
bring up to perl 5.12 standard (this is old code)
|
|
|
|
--- majordomo.pl.orig 2000-01-07 12:32:04.000000000 +0000
|
|
+++ majordomo.pl
|
|
@@ -44,7 +44,7 @@ $DEBUG = $main'DEBUG;
|
|
|
|
sub main'ParseMailHeader ## Public
|
|
{
|
|
- local($save1, $save2) = ($*, $/);
|
|
+ local($save) = ($/);
|
|
local($FH, *array) = @_;
|
|
local ($keyw, $val);
|
|
|
|
@@ -54,7 +54,7 @@ sub main'ParseMailHeader ## Public
|
|
local($package) = caller;
|
|
$FH =~ s/^[^':]+$/$package'$&/;
|
|
|
|
- ($*, $/) = (1, '');
|
|
+ $/ = '';
|
|
$array = $_ = <$FH>;
|
|
s/\n\s+/ /g;
|
|
|
|
@@ -69,7 +69,7 @@ sub main'ParseMailHeader ## Public
|
|
$array{$keyw} = $val;
|
|
}
|
|
}
|
|
- ($*, $/) = ($save1, $save2);
|
|
+ $/ = $save;
|
|
}
|
|
|
|
|
|
@@ -95,14 +95,14 @@ sub main'ParseAddrs {
|
|
local($_) = shift;
|
|
1 while s/\([^\(\)]*\)//g; # strip comments
|
|
1 while s/"[^"]*"\s//g; # strip comments"
|
|
- split(/,/); # split into parts
|
|
- foreach (@_) {
|
|
+ my @parts = split(/,/); # split into parts
|
|
+ foreach (@parts) {
|
|
1 while s/.*<(.*)>.*/$1/;
|
|
s/^\s+//;
|
|
s/\s+$//;
|
|
}
|
|
|
|
- @_;
|
|
+ @parts;
|
|
}
|
|
|
|
# Check to see if a list is valid. If it is, return the validated list
|
|
@@ -341,6 +341,8 @@ sub main'set_log {
|
|
# Log a message to the log
|
|
sub main'log {
|
|
|
|
+ my @month=qw( Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec );
|
|
+
|
|
print STDERR "$0: main'log()\n" if $DEBUG;
|
|
|
|
local($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime;
|
|
@@ -351,7 +353,7 @@ sub main'log {
|
|
if (&main'lopen(LOG, ">>", $log_file)) { #';
|
|
# if the log is open, write to the log
|
|
printf LOG "%s %02d %02d:%02d:%02d %s %s[%d] {%s} ",
|
|
- $ctime'MoY[$mon], $mday, $hour, $min, $sec,
|
|
+ $month[$mon], $mday, $hour, $min, $sec,
|
|
$log_host, $log_program, $$, $log_session;
|
|
print LOG join(" ", @_), "\n";
|
|
&main'lclose(LOG);
|