diff --git a/LinkOpener.pm b/LinkOpener.pm index 82b9744..d8b1ee5 100644 --- a/LinkOpener.pm +++ b/LinkOpener.pm @@ -8,6 +8,7 @@ sub get_links { open(my $fh, '<', $link_data) || die("Unable to open file ($link_data) for read: $!\n"); while (my $line = <$fh>) { chomp($line); + next unless $line; # don't process blank lines my ($link, $alias, $count) = split(/\|/, $line); $links{$link} = { link => $link, @@ -33,7 +34,8 @@ sub add_url { my ($url, $name) = @_; $name ||= ''; open(my $fh, '>>', $link_data) || die("Unable to open file ($link_data) for append: $!\n"); - print $fh join($sep, $url, $name) . "\n"; + # extra \n incase someone removed the last empty line + print $fh "\n" . join($sep, $url, $name) . "\n"; close($fh); } diff --git a/info.plist b/info.plist index 9bae3ab..e586769 100644 --- a/info.plist +++ b/info.plist @@ -360,7 +360,7 @@ perl linkopener.pl "$query" 2>&1 variablesdontexport version - 0.0.6 + 0.0.8 webaddress https://github.com/skeletonkey/link_opener