summaryrefslogtreecommitdiff
path: root/gmi.pl
diff options
context:
space:
mode:
Diffstat (limited to 'gmi.pl')
-rwxr-xr-xgmi.pl15
1 files changed, 11 insertions, 4 deletions
diff --git a/gmi.pl b/gmi.pl
index 85d0df7..5fe0699 100755
--- a/gmi.pl
+++ b/gmi.pl
@@ -10,7 +10,7 @@ use bytes;
use feature qw(refaliasing);
no warnings qw(experimental::refaliasing);
-our $VERSION = 'v0.0.15';
+our $VERSION = 'v0.0.16';
# TODO:
# back() only works once; should fix this
@@ -34,7 +34,7 @@ my $doc;
my @links;
my $current_url = "";
my @history;
-my $prompt = "$current_url> ";
+my $prompt = "";
my %commands = (
'url' => [sub { url($_[0],0) }, 'Go to the specified URL.'],
@@ -90,7 +90,7 @@ my %commands = (
print "Type 'cmds' to see available commands.\n";
while () {
- $prompt = "$current_url> ";
+ $prompt = "$current_url > ";
print "$prompt";
chomp(my $input = <STDIN>);
@@ -164,7 +164,14 @@ sub url {
$url->{host} = $c_url->{host};
$url->{port} = $c_url->{port};
- my $cp_url = split_url_path($c_url->{path}, 256);
+
+ my $cp_url;
+ if ($c_url->{path}) {
+ $cp_url = split_url_path($c_url->{path}, 256);
+ }
+ else {
+ $cp_url = [''];
+ }
$c_url->{path} = '';
#if ( $url->{path} =~ m|\.\.| or $url->{path} =~ m|^\./?|) {