From c6dfbb11469ffe6c5318037a83059463eb9f2894 Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Fri, 22 Jun 2007 20:42:58 +0100 Subject: [PATCH] handle single options in Debbugs::SOAP correctly --- Debbugs/SOAP.pm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Debbugs/SOAP.pm b/Debbugs/SOAP.pm index 7ab55e2..2d8306c 100644 --- a/Debbugs/SOAP.pm +++ b/Debbugs/SOAP.pm @@ -119,9 +119,18 @@ sub get_bugs{ my $VERSION = __populate_version(pop); my ($self,@params) = @_; my %params; + # Because some clients can't handle passing arrayrefs, we allow + # options to be specified multiple times while (my ($key,$value) = splice @params,0,2) { push @{$params{$key}}, make_list($value); } + # However, for singly specified options, we want to pull them + # back out + for my $key (keys %params) { + if (@{$params{$key}} == 1) { + ($params{$key}) = @{$params{key}} + } + } my @bugs; @bugs = Debbugs::Bugs::get_bugs(%params); return \@bugs; -- 2.39.2