summaryrefslogtreecommitdiff
path: root/gmi2email
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-01-27 18:10:46 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-01-27 18:10:46 -0700
commit891877f7b1bbb1dea0f82ec6e577dc0cb3ce51e0 (patch)
treea3ede1b0b5be9d956b083c2c8f93df7a18f9b683 /gmi2email
parentf83c52007dde3fa3b243a0fe3ac6bb052b963b71 (diff)
downloadmailscripts-891877f7b1bbb1dea0f82ec6e577dc0cb3ce51e0.tar.gz
gmi2email: handle ./ links
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
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$'";