commit ede02bb3ab88475262a7999888f427d7492222fd
parent e9b6580368b7858bd4903bf8fd04f22071a0c2ac
Author: René Wagner <rwa@clttr.info>
Date: Sun, 6 Aug 2023 16:49:47 +0200
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
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git 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