From: Paul Hänsch Date: Tue, 6 Jun 2023 22:28:45 +0000 (+0200) Subject: avoid nonexitent globs in attachment_glob() (i.e. foo-*.bar) X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=2bf03aa546d241307bc05d5f2fe101ef67726970;p=shellwiki avoid nonexitent globs in attachment_glob() (i.e. foo-*.bar) --- diff --git a/tools.sh b/tools.sh index b714ec6..6388e3f 100755 --- a/tools.sh +++ b/tools.sh @@ -83,6 +83,7 @@ attachment_glob(){ esac \ | sort -u \ | while read -r glob; do + [ -e "$glob" ] || continue pagedir="$(page_abs "${glob%%/#attachments/*}/")" [ -d "$_DATA/pages/$pagedir" -o -d "$_EXEC/pages/$pagedir" ] \ && printf '%s\n' "${glob%%/#attachments/*}/${glob#*/#attachments/}"