From b49c7fa48b79a3bba20fcbd817a6f619edd1ef21 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Tue, 1 Apr 2014 22:09:29 +0000 Subject: [PATCH] small bug fix with null partitions array print out --- inxi | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/inxi b/inxi index c90def3..1f06e62 100755 --- a/inxi +++ b/inxi @@ -8908,6 +8908,7 @@ get_weather_data() # args: $1 - string to strip color code characters out of # returns count of string length minus colors +# note; this cleanup may not be working on bsd sed calculate_line_length() { local string=$1 @@ -10526,14 +10527,14 @@ print_networking_ip_data() if_string='' fi else - if [[ $( calculate_line_length "$if_string_holding$if_string" ) -lt $COLS_INNER ]];then - if_string_holding="$if_string_holding$if_string" - else + if [[ $( calculate_line_length "$if_string_holding$if_string" ) -gt $COLS_INNER ]];then if [[ -n $if_string_holding ]];then full_string=$( create_print_line " " "$if_string_holding${CN}" ) print_screen_output "$full_string" fi if_string_holding="$if_string" + else + if_string_holding="$if_string_holding$if_string" fi fi ((i++)) @@ -10843,8 +10844,10 @@ print_partition_data() else line_starter=' ' fi - partition_data=$( create_print_line "$line_starter" "${a_partition_data[$i]}${CN}" ) - print_screen_output "$partition_data" + if [[ -n ${a_partition_data[$i]} ]];then + partition_data=$( create_print_line "$line_starter" "${a_partition_data[$i]}${CN}" ) + print_screen_output "$partition_data" + fi done eval $LOGFE