summaryrefslogtreecommitdiff
path: root/gmi2email
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-01-28 16:03:03 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-01-28 16:20:52 -0700
commit182d28e47858c183d3be2e172c400e3b0521167f (patch)
tree3ed519c8a97970418bfc12b5004b0041c750a9c9 /gmi2email
parentf86afc9f4f372d0322d693e9b767d924e08a7682 (diff)
downloadmailscripts-182d28e47858c183d3be2e172c400e3b0521167f.tar.gz
gmi2email: avoid some uninitialised variables
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'gmi2email')
-rwxr-xr-xgmi2email6
1 files changed, 3 insertions, 3 deletions
diff --git a/gmi2email b/gmi2email
index 0d9861b..fcf0f0e 100755
--- a/gmi2email
+++ b/gmi2email
@@ -166,14 +166,14 @@ sub send_subscribed_gemtext {
} catch {
warn "when fetching $uri, $_";
my ($code) = /"gemini error: ([1-6])/;
- if ($code == 4) {
+ if ($code and $code == 4) {
return; # try again next run
} else {
$mail = 0; # don't try this one again
}
};
#>>>
- if ($type =~ m{^text/gemini}) {
+ if ($type and $type =~ m{^text/gemini}) {
gemtext_to_mail(
$data, %to_mail_opts,
gemlog => $gemlog // "unknown gemlog",
@@ -236,7 +236,7 @@ sub gemini_fetch {
} else {
@lines = <$cl>;
}
- push @lines, "" unless $lines[$#lines] eq "";
+ push @lines, "" unless !@lines or $lines[$#lines] eq "";
push @lines, "Retrieved from $uri\n at " . localtime;
return $meta, \@lines;
} else {