diff options
author | Tatsuya Kinoshita <tats@debian.org> | 2020-09-25 12:43:47 +0000 |
---|---|---|
committer | Tatsuya Kinoshita <tats@debian.org> | 2020-09-25 12:43:47 +0000 |
commit | ea47145ea82155bfe629667fdf4c709256937cac (patch) | |
tree | 0c74a30cd5ddf53e0c11e1a4d320dbb3e292a31f /scripts/w3mman | |
parent | Remove -l flag in CGI script (diff) | |
download | w3m-ea47145ea82155bfe629667fdf4c709256937cac.tar.gz w3m-ea47145ea82155bfe629667fdf4c709256937cac.zip |
Assume a local file if the argument contains slash for w3mman
Diffstat (limited to 'scripts/w3mman')
-rw-r--r-- | scripts/w3mman/w3mman.in | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/scripts/w3mman/w3mman.in b/scripts/w3mman/w3mman.in index fae7a41..5cff68f 100644 --- a/scripts/w3mman/w3mman.in +++ b/scripts/w3mman/w3mman.in @@ -22,9 +22,12 @@ while (@ARGV) { @ARGV || &usage(); if ( $query eq "" ) { $query = "?quit=ok"; } $query .= "&keyword=" . &form_encode(shift @ARGV); - } elsif (/^-l$/) { - @ARGV || &usage(); - $query = "?quit=ok&local=" . &form_encode(shift @ARGV); + } elsif (/^-l$/ || /\//) { + if (/^-l$/) { + @ARGV || &usage(); + $_ = shift @ARGV; + } + $query = "?quit=ok&local=" . &form_encode($_); $query .= "&pwd=" . &form_encode($ENV{'PWD'}); } elsif (/^-/) { &usage(); |