From: Paul Hänsch Date: Sun, 20 Aug 2023 21:35:48 +0000 (+0200) Subject: bugfix: prevent globbing of :translation pages with --system parameter X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=14a651b8b65411e8027156015722b8a836daa9d2;p=shellwiki bugfix: prevent globbing of :translation pages with --system parameter --- diff --git a/tools.sh b/tools.sh index d147b73..4e93d3f 100755 --- a/tools.sh +++ b/tools.sh @@ -106,22 +106,17 @@ page_glob(){ esac \ | sort -u \ | while read -r page; do - case $page in - \#*|*/\#*) # Not a page directory (just a metadata dir) - continue - ;; - \[*\]/*|*/\[*\]/*) # Omit "system" pages unless explicitly wanted - [ "$glob_system_pages" != true ] \ - && continue \ - || pagedir="$(page_abs "$page")" - ;; - \:*|*/\:*) # Omit translation pages if translations are enabled - [ "$LANGUAGE_DEFAULT" ] \ - && continue \ - || pagedir="$(page_abs "$page")" - ;; - *) pagedir="$(page_abs "$page")";; - esac + # Not a page directory (just a metadata dir) + [ ! "${page%%#*}" -o ! "${page%%*/#*}" ] && continue + + # Omit "system" pages unless explicitly wanted + [ ! "${page%%\[*\]/*}" -o ! "${page%%*/\[*\]/*}" ] && [ "$glob_system_pages" != true ] && continue + + # Omit translation pages if translations are enabled + [ ! "${page%%:*}" -o ! "${page%%*/:*}" ] && [ "$LANGUAGE_DEFAULT" ] && continue + + pagedir="$(page_abs "$page")" + if [ -d "$_DATA/pages/$pagedir" -o -d "$_EXEC/pages/$pagedir" ]; then printf '%s\n' "$page" if ! [ "$depth" -eq 0 ]; then