X-Git-Url: https://git.sthu.org/?a=blobdiff_plain;f=keylookup%2Fkeylookup;h=44fae86d1999b5a60f1f71e47e336975d2bf062e;hb=cafe830492c69083459397b82f0b17997549864d;hp=4c097a92c4dd2f9bc12d398dc96a2db541e7132b;hpb=25463a8569ab7ca61d212e50d8beddf4f9975754;p=pgp-tools.git diff --git a/keylookup/keylookup b/keylookup/keylookup index 4c097a9..44fae86 100755 --- a/keylookup/keylookup +++ b/keylookup/keylookup @@ -95,7 +95,7 @@ sub getHits($) { push @ops, '--with-colons'; push @ops, '--fixed-list-mode'; push @ops, '--search'; - push @ops, $options->{'search'}; + push @ops, @{$options->{'search'}}; exec(@ops); die ("Cannot exec GnuPG: $!\n"); }; @@ -345,13 +345,14 @@ sub version { ## Take all additional arguments to the program as a search target, ## escape the string for use in URLs. - $options{'search'} = join ' ', @ARGV; - $options{'search'} =~ s/ ( [^A-Za-z0-9] ) - / '%' . unpack("H2", $1) - /xeg; + $options{'search'} = \@ARGV; my $keys = getHits( \%options ); my $keyids; + if (scalar keys %$keys == 0) { + print "GnuPG did not find any keys matching your search string.\n"; + exit 0; + }; if ($options{'importall'}) { my @allkeys = keys %$keys; $keyids = \@allkeys;