diff options
author | Case Duckworth | 2020-06-02 22:37:27 -0500 |
---|---|---|
committer | Case Duckworth | 2020-06-02 22:37:27 -0500 |
commit | 3fdc06e3808b94909a7e3e44a9d354230f01efbb (patch) | |
tree | d9d00db1aa59dad02c185074b229b1965349f1d6 | |
parent | Change variables and update manpages (diff) | |
download | bollux-3fdc06e3808b94909a7e3e44a9d354230f01efbb.tar.gz bollux-3fdc06e3808b94909a7e3e44a9d354230f01efbb.zip |
Fix title extraction
-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*) |