From 47009795c4998f1571a6f97de463d43f73defdc4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Tue, 22 Feb 2022 15:15:10 +0100 Subject: [PATCH] avoid one level of indirection --- list.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/list.sh b/list.sh index 86b60fd..ccb9139 100755 --- a/list.sh +++ b/list.sh @@ -7,11 +7,6 @@ list_item() { local meta file link name eval "$LOCAL_META" - meta="${1}"; - - read_meta <<-EOF - $meta - EOF if [ "${META_NAME%/}" != "${META_NAME}" ]; then printf '[a .list .dir href="%s?%s" . %s]' \ @@ -164,9 +159,14 @@ list_paginate() { end=$((page + LISTSIZE)) printf '[div .itemlist ' - while read -r i; do + while :; do c=$((c + 1)) - [ $c -gt $page -a $c -le $end ] && list_item "$i" + if [ $c -gt $page -a $c -le $end ]; then + read_meta || break + list_item + else + read -r discard || break + fi done printf ']' -- 2.39.2