From 88d7ae33a92feb6072f4e876f310f8e67a1fc810 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sun, 31 May 2020 10:28:59 -0500 Subject: Trim mime and only look at it once --- bollux | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bollux b/bollux index 63dfe85..4864e48 100755 --- a/bollux +++ b/bollux @@ -353,12 +353,13 @@ handle_response() { display() { # split header line local -a hdr + local i IFS=$'\n' read -d "" -ra hdr <<<"${1//;/$'\n'}" - mime="${hdr[0],,}" - for h in "${hdr[@]}"; do - h="$(trim "$h")" - log d "$h" + mime="$(trim "${hdr[0],,}")" + for ((i=1;i<="${#hdr[@]}";i++)); do + h="$(trim "${hdr[$i]}")" + log d "'$h'" case "$h" in charset=*) charset="${h#charset=}" ;; esac -- cgit 1.4.1-21-gabe81