diff options
Diffstat (limited to 'gmi.pl')
-rwxr-xr-x | gmi.pl | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -10,7 +10,7 @@ use bytes; use feature qw(refaliasing); no warnings qw(experimental::refaliasing); -our $VERSION = 'v0.0.20'; +our $VERSION = 'v0.0.21'; # TODO: # back() only works once; should fix this @@ -39,8 +39,8 @@ my @history; my $prompt = ""; my %commands = ( - 'url' => [sub { url($_[0],0) }, 'Go to the specified URL.'], - 'u' => [sub { url($_[0],0) }, 'Alias of `url\''], + 'url' => [sub { url($_[0]) }, 'Go to the specified URL.'], + 'u' => [sub { url($_[0]) }, 'Alias of `url\''], 'urlrelative' => [sub { urlrelative($_[0]) }, "Navigate the current URL relatively.\n\n" ."Note: if the current path is '/blog/my-post1.gmi' and 'my-post2.gmi'\n" . @@ -209,7 +209,8 @@ sub url { sub urlrelative { my ($urlr) = @_; - if (!$current_url) {print "Relative movement impossible: no current URL.\n"; return 1;} + if (! $urlr) { $urlr = ""} + if (! $current_url) {print "Relative movement impossible: no current URL.\n"; return 1;} my $end_with_slash = 1 if ($urlr =~ m|/$|); my $dot_only = 1 if ($urlr =~ m|^\.$|); my $dot_2_only = 1 if ($urlr =~ m|^\.\.$|); # since we are going up into a dir |