From bd18cdd0b07c291c9b5bd7a852dd2024a286b910 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 23 Jan 2003 16:41:42 +0000 Subject: (is_fbdev): created (get_both, set_both): skip modifications on missing xfree3 or xfree4 --- perl-install/Xconfig/xfree.pm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'perl-install/Xconfig/xfree.pm') diff --git a/perl-install/Xconfig/xfree.pm b/perl-install/Xconfig/xfree.pm index 89b06a61f..335187a2f 100644 --- a/perl-install/Xconfig/xfree.pm +++ b/perl-install/Xconfig/xfree.pm @@ -47,15 +47,17 @@ sub get_monitor { get_both('get_monitor', @_) } sub get_monitors { get_both('get_monitors', @_) } sub set_monitors { set_both('set_monitors', @_) } +sub is_fbdev { get_both('is_fbdev', @_) } + #-############################################################################## #- helpers #-############################################################################## sub get_both { my ($getter, $both) = @_; - if ($both->{xfree3}) { - $both->{xfree4}->$getter; - } elsif ($both->{xfree4}) { + if (is_empty_array_ref($both->{xfree3})) { + $both->{xfree3}->$getter; + } elsif (is_empty_array_ref($both->{xfree4})) { $both->{xfree3}->$getter; } else { my @l3 = $both->{xfree3}->$getter; @@ -66,8 +68,8 @@ sub get_both { sub set_both { my ($setter, $both, @l) = @_; - $both->{xfree3}->$setter(@l) if $both->{xfree3}; - $both->{xfree4}->$setter(@l) if $both->{xfree4}; + $both->{xfree3}->$setter(@l) if !is_empty_array_ref($both->{xfree3}); + $both->{xfree4}->$setter(@l) if !is_empty_array_ref($both->{xfree4}); } sub merge_values { -- cgit v1.2.1