From 7823ece977875aa84460a1415c7cfab7fa96aa1a Mon Sep 17 00:00:00 2001 From: Thomas Hochstein Date: Fri, 26 Feb 2010 09:29:01 +0100 Subject: [PATCH] Fix default for Expires. Bug introduced in v0.6.1. Signed-off-by: Thomas Hochstein --- yapfaq.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/yapfaq.pl b/yapfaq.pl index be8762c..fcee811 100644 --- a/yapfaq.pl +++ b/yapfaq.pl @@ -152,7 +152,6 @@ sub readconfig{ $Error .= "E: The Posting-frequency for your project \"$$Config[$i]{'name'}\" is invalid.\n" } unless(!$$Config[$i]{'expires'} || $$Config[$i]{'expires'} =~ /^\s*\d+\s*[dwmy]\s*$/) { - $$Config[$i]{'expires'} = '3m'; # set default: 3 month warn "$0: W: The Expires for your project \"$$Config[$i]{'name'}\" is invalid - set to 3 month.\n"; } $Error .= "-" x 25 . "\n" if $Error; @@ -223,7 +222,9 @@ sub postfaq { my $wday = ("Sun","Mon","Tue","Wed","Thu","Fri","Sat")[$time[6]]; my $year = (1900 + $time[5]); my $tz = $time[8] ? " +0200" : " +0100"; - + + $$Expire = '3m' if !$$Expire; # set default if unset: 3 month + my ($expY,$expM,$expD) = calcdelta ($year,$month,$day,$$Expire); my $expmonthN = ("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")[$expM-1];