summaryrefslogtreecommitdiff
path: root/localmarkdown2sms
diff options
context:
space:
mode:
Diffstat (limited to 'localmarkdown2sms')
-rwxr-xr-xlocalmarkdown2sms10
1 files changed, 4 insertions, 6 deletions
diff --git a/localmarkdown2sms b/localmarkdown2sms
index 6a4a9cf..ddc1366 100755
--- a/localmarkdown2sms
+++ b/localmarkdown2sms
@@ -82,7 +82,7 @@ foreach my $file (read_dir( $path )) {
warn( "skipping non-parsable headline \"$line\" in file \"$file\"");
}
# reply
- } else {
+ } elsif ( defined( $key )) {
$content = $reply{$key}[$i] if (defined($reply{$key}[$i]));
$content .= $line . "\n";
$content =~ s/^\h*$//g; # clean virtually empty lines
@@ -90,11 +90,9 @@ foreach my $file (read_dir( $path )) {
$content =~ s/\n\n+/\n\n/g; # strip excess newlines
$content =~ s/(\S)\n([^\n])/$1 $2/g; # convert newline to space
$content =~ s/\h*$//g; # strip all trailing spaces
- if ( defined( $key )) {
- $reply{$key}[$i] = $content;
- } else {
- warn( "skipping non-key'ed content \"$1\" in file \"$file\"" );
- }
+ $reply{$key}[$i] = $content;
+ } else {
+ warn( "skipping non-key'ed content \"$line\" in file \"$file\"" );
}
}
# tidy latest reply (TODO: use sub)