From 5ddba442dab41b5b28d060320a9e2363a768a9a5 Mon Sep 17 00:00:00 2001 From: Thomas Hochstein Date: Fri, 26 Feb 2010 08:28:06 +0100 Subject: [PATCH] Fix: Test mode must not update status information. Also fix runtime warning concerning expires. Signed-off-by: Thomas Hochstein --- yapfaq.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/yapfaq.pl b/yapfaq.pl index 8e607e2..a6dc986 100644 --- a/yapfaq.pl +++ b/yapfaq.pl @@ -151,7 +151,7 @@ sub readconfig{ unless($$Config[$i]{'posting-frequency'} =~ /^\s*\d+\s*[dwmy]\s*$/) { $Error .= "E: The Posting-frequency for your project \"$$Config[$i]{'name'}\" is invalid.\n" } - unless($$Config[$i]{'expires'} =~ /^\s*\d+\s*[dwmy]\s*$/) { + 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"; } @@ -266,6 +266,9 @@ sub postfaq { } post(\@Article); + # Test mode? + return if($Options{'t'}); + if($Options{'v'}) { print "$$ActName: Save status information.\n"; }