From b71c5ec462cf3dc9591c88c4c39aeb65c156f50a Mon Sep 17 00:00:00 2001 From: Tatsuya Kinoshita Date: Mon, 30 Aug 2021 20:19:07 +0900 Subject: [PATCH] Fix incorrect query string for `w3mman 7z` Bug-Debian: https://github.com/tats/w3m/issues/191 --- scripts/w3mman/w3mman.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/w3mman/w3mman.in b/scripts/w3mman/w3mman.in index 061cb1f..3c9a546 100644 --- a/scripts/w3mman/w3mman.in +++ b/scripts/w3mman/w3mman.in @@ -31,7 +31,7 @@ while (@ARGV) { $query .= "&pwd=" . &form_encode($ENV{'PWD'}); } elsif (/^-/) { &usage(); - } elsif (/^\d/ || $_ eq 'n' || $_ eq 'l') { + } elsif ($query !~ /§ion=/ && (/^\d/ || $_ eq 'n' || $_ eq 'l')) { if ( $query eq "" ) { $query = "?quit=ok"; } $query .= "§ion=" . &form_encode($_); } else { @@ -39,6 +39,9 @@ while (@ARGV) { $query .= "&man=" . &form_encode($_); } } +if ($query =~ /§ion=/ && $query !~ /&keyword=/ && $query !~ /&man=/) { + $query =~ s/§ion=/&man=/; +} exec @W3M, "$SCRIPT$query";