From 5f1d54bf4be91b197b7089f9613c5c723b59459c Mon Sep 17 00:00:00 2001 From: "Bradley M. Kuhn" Date: Wed, 19 Feb 2014 18:22:48 -0500 Subject: [PATCH] This really should have had the loop first, then the test. I am left wondering if there was actually I reason I wrote it the other way, and no time to run git blame to see why. --- calendar-export.plx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/calendar-export.plx b/calendar-export.plx index 8010d90..b7662d4 100755 --- a/calendar-export.plx +++ b/calendar-export.plx @@ -570,13 +570,11 @@ if (defined $config->{cleanOutputDirFirst} and $config->{cleanOutputDirFirst}) { system("/bin/rm -f *.ics"); } -unless ((defined $config->{publicDiary} and -r $config->{publicDiary}) or - (defined $config->{privateyDiary} and -r $config->{privateDiary})) { - foreach my $key (qw/publicDiary privateDiary/) { - print "\${color5}$key file, $config->{$key} does not exist\n" - if defined $config->{$key} +foreach my $key (qw/publicDiary privateDiary/) { + unless (defined $config->{$key} and -r $config->{$key}) { + print "\${color5}$key file, $config->{$key} does not exist\n"; + exit 1; } - exit 1; } FilterEmacsToICal($config->{publicDiary}, $config->{privateDiary}, $config->{outputDir}, $config, $config->{user});