From 354c44eb769274947db81ed5c995ea004df1b931 Mon Sep 17 00:00:00 2001 From: Harald Hope Date: Fri, 10 Jun 2022 13:29:28 -0700 Subject: [PATCH] bug fix for openbsd -i --- inxi | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/inxi b/inxi index 2932417..184c1d1 100755 --- a/inxi +++ b/inxi @@ -18297,6 +18297,7 @@ sub advanced_data_bsd { ($cont_if,$ind_if) = (1,2); } foreach my $item (@ifs_bsd){ + if (ref $item ne 'ARRAY'){ $working_if = $item; # print "$working_if\n"; @@ -18337,9 +18338,9 @@ sub advanced_data_bsd { $rows->[$j]{main::key($num++,0,$ind_if,'duplex')} = $duplex; } $rows->[$j]{main::key($num++,0,$ind_if,'mac')} = $mac; - } - if ($show{'ip'} && $if){ - if_ip($rows,$key,$if); + if ($show{'ip'} && $if){ + if_ip($rows,$key,$if); + } } } eval $end if $b_log; @@ -18353,7 +18354,7 @@ sub advanced_data_bsd { sub if_ip { eval $start if $b_log; my ($rows,$type,$if) = @_; - my (@data,$working_if); + my ($working_if); my ($cont_ip,$ind_ip) = (3,4); my $num = 0; my $j = 0; @@ -18368,17 +18369,14 @@ sub if_ip { # print "if:$if wif:$working_if\n"; next; } - else { - @data = @$item; - # print "ref:$item\n"; - } if ($working_if eq $if){ - foreach my $data2 (@data){ + # print "if $if item:\n", Data::Dumper::Dumper $item; + foreach my $data2 (@$item){ $j = scalar @$rows; $num = 1; if ($limit > 0 && $j >= $limit){ push(@$rows, { - main::key($num++,0,$cont_ip,'Message') => main::message('output-limit',scalar @data), + main::key($num++,0,$cont_ip,'Message') => main::message('output-limit',scalar @$item), }); last OUTER; } @@ -28713,14 +28711,12 @@ sub set_ifconfig { $scope = $2; } $scope = 'link' if $ip =~ /^fe80/; - @temp = ($type,$ip,$broadcast,$scope,$if_id); - push(@ips,[@temp]); + push(@ips,[$type,$ip,$broadcast,$scope,$if_id]); # print Data::Dumper::Dumper \@ips; } } if (@ips){ - @temp = ($if,[@ips]); - push(@ifs,@temp); + push(@ifs,($if,[@ips])); } if ($mac){ @temp = ($if,[($state,$speed,$duplex,$mac)]);