summaryrefslogtreecommitdiff
path: root/gmi2email
diff options
context:
space:
mode:
Diffstat (limited to 'gmi2email')
-rwxr-xr-xgmi2email5
1 files changed, 4 insertions, 1 deletions
diff --git a/gmi2email b/gmi2email
index 1015328..9fa4c23 100755
--- a/gmi2email
+++ b/gmi2email
@@ -212,11 +212,14 @@ sub gemini_fetch {
my @lines;
if ($opts{abs_links}) {
$path =~ s{^/}{};
+ (my $dir = $path) =~ s{[^/]*$}{};
$authority =~ m{/$} or $authority .= "/";
$path =~ m{/$} or $path .= "/";
for (<$cl>) {
s/\r?\n\z//;
- if (m{^=> (?!/)} and not m{^=> [a-z]+://}) {
+ if (m{^=>\s*\./}) {
+ push @lines, "=> gemini://$authority$dir$'";
+ } elsif (m{^=> (?!/)} and not m{^=> [a-z]+://}) {
push @lines, "=> gemini://$authority$path$'";
} elsif (m{^=> /}) {
push @lines, "=> gemini://$authority$'";