From 3fdc06e3808b94909a7e3e44a9d354230f01efbb Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 2 Jun 2020 22:37:27 -0500 Subject: Fix title extraction --- bollux | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bollux b/bollux index 0a1976b..5e03da3 100755 --- a/bollux +++ b/bollux @@ -339,17 +339,20 @@ handle_response() { 2*) REDIRECTS=0 # read ahead to find a title + pretitle= while read -r; do - printf -v pretitle "%s\n" "$REPLY" + pretitle="$pretitle$REPLY"$'\n' if [[ "$REPLY" =~ ^#[[:space:]]*(.*) ]]; then title="${BASH_REMATCH[1]}" break fi done - run history_append "$URL" "$title" + run history_append "$URL" "${title:-}" { printf '%s' "$pretitle" - while read -r; do printf '%s\n' "$REPLY"; done + while read -r; do + printf '%s\n' "$REPLY" + done } | run display "$meta" ;; 3*) -- cgit 1.4.1-21-gabe81