From: Paul Hänsch Date: Tue, 22 Feb 2022 14:15:10 +0000 (+0100) Subject: avoid one level of indirection X-Git-Url: http://git.plutz.net/?p=serve0;a=commitdiff_plain;h=47009795c4998f1571a6f97de463d43f73defdc4 avoid one level of indirection --- 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 ']'