From c04107ac8b16c99e2ab2b4b2a255e67f5eba3ae2 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 24 Jul 2002 22:32:49 +0000 Subject: (get_both): fix returning one element (eg: get_keyboard) --- perl-install/Xconfig/xfree.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/perl-install/Xconfig/xfree.pm b/perl-install/Xconfig/xfree.pm index 7b6ba3e37..43c4fe885 100644 --- a/perl-install/Xconfig/xfree.pm +++ b/perl-install/Xconfig/xfree.pm @@ -43,7 +43,7 @@ sub get_both { my @l3 = $both->{xfree3}->$getter; my @l4 = $both->{xfree4}->$getter; - mapn { + my @r = mapn { my ($h3, $h4) = @_; my %h = %$h4; foreach (keys %$h3) { @@ -63,6 +63,8 @@ sub get_both { } \%h; } \@l3, \@l4; + + @r == 1 ? $r[0] : @r; } sub set_both { my ($setter, $both, @l) = @_; -- cgit v1.2.1