From ede02bb3ab88475262a7999888f427d7492222fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Wagner?= Date: Sun, 6 Aug 2023 16:49:47 +0200 Subject: [PATCH] fix missing last line when page doesn't end with a new line Due to the behaviour of `read` the current implementation will drop the content of the last line of a page if it's not followed by an empty newline. solution found (it's an interesting read besides that) at: https://stackoverflow.com/questions/12916352/shell-script-read-missing-last-line --- astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/astro b/astro index c9176e2..e520e88 100755 --- a/astro +++ b/astro @@ -163,7 +163,7 @@ parseurl() { } typesetgmi() { - while IFS='' read -r line + while IFS='' read -r line || [ -n "$line" ]; do line="$(echo "$line" | tr -d '\r')" # shellcheck disable=SC2016