diff options
-rwxr-xr-x | bollux | 9 |
1 files 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() { | |||
339 | 2*) | 339 | 2*) |
340 | REDIRECTS=0 | 340 | REDIRECTS=0 |
341 | # read ahead to find a title | 341 | # read ahead to find a title |
342 | pretitle= | ||
342 | while read -r; do | 343 | while read -r; do |
343 | printf -v pretitle "%s\n" "$REPLY" | 344 | pretitle="$pretitle$REPLY"$'\n' |
344 | if [[ "$REPLY" =~ ^#[[:space:]]*(.*) ]]; then | 345 | if [[ "$REPLY" =~ ^#[[:space:]]*(.*) ]]; then |
345 | title="${BASH_REMATCH[1]}" | 346 | title="${BASH_REMATCH[1]}" |
346 | break | 347 | break |
347 | fi | 348 | fi |
348 | done | 349 | done |
349 | run history_append "$URL" "$title" | 350 | run history_append "$URL" "${title:-}" |
350 | { | 351 | { |
351 | printf '%s' "$pretitle" | 352 | printf '%s' "$pretitle" |
352 | while read -r; do printf '%s\n' "$REPLY"; done | 353 | while read -r; do |
354 | printf '%s\n' "$REPLY" | ||
355 | done | ||
353 | } | run display "$meta" | 356 | } | run display "$meta" |
354 | ;; | 357 | ;; |
355 | 3*) | 358 | 3*) |