From 95a00e11d0dd65d2d45d2446d52894c144e6fa10 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Thu, 13 Aug 2009 20:38:38 +0200 Subject: Simplify warning logic, silencing warning about empty lines. --- localmarkdown2sms | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'localmarkdown2sms') diff --git a/localmarkdown2sms b/localmarkdown2sms index 0ca6abb..745ae83 100755 --- a/localmarkdown2sms +++ b/localmarkdown2sms @@ -101,10 +101,10 @@ foreach my $file (read_dir( $path )) { if ($content ne $1) { WARN "delay (${delay}s) resolved from fuzzy string \"$content\" in file \"$file\""; } - } elsif ($skipkey) { + } elsif ($skipkey or $warn_nonkey_delay) { # skipping - already warned about it... } else { - WARN "ignoring non-key'ed delay line \"$1\" in file \"$file\"" unless ($warn_nonkey_delay); + WARN "ignoring non-key'ed delay line \"$1\" in file \"$file\""; $warn_nonkey_delay = 1; $skipcontent = 1; } @@ -123,10 +123,10 @@ foreach my $file (read_dir( $path )) { }; if ( defined( $key ) and not ($skipcontent)) { $reply{$key}[$i] .= $content; - } elsif ($skipkey or $skipcontent) { + } elsif ($skipkey or $skipcontent or $warn_nonkey_content) { # skipping - already warned about it... } else { - WARN "skipping non-key'ed content \"$line\" in file \"$file\"" unless ($warn_nonkey_content); + $content =~ /\S/s && WARN "skipping non-key'ed content \"$line\" in file \"$file\""; $warn_nonkey_content = 1; } } -- cgit v1.2.3