diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-01-27 18:10:46 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-01-27 18:10:46 -0700 |
commit | 891877f7b1bbb1dea0f82ec6e577dc0cb3ce51e0 (patch) | |
tree | a3ede1b0b5be9d956b083c2c8f93df7a18f9b683 | |
parent | f83c52007dde3fa3b243a0fe3ac6bb052b963b71 (diff) | |
download | mailscripts-891877f7b1bbb1dea0f82ec6e577dc0cb3ce51e0.tar.gz |
gmi2email: handle ./ links
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rwxr-xr-x | gmi2email | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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$'"; |