X-Git-Url: http://git.plutz.net/?a=blobdiff_plain;f=list.sh;h=8b8ea8e59e847d959432b6ba9ca45fad7d190bd6;hb=d3c3721309a5e6080162c00787f86299fa8d453f;hp=e8b7075f1f889ac3c4527dab07d9e475b4d005d9;hpb=d6c1406a5507f83acc0433189ad89d40560f1f08;p=serve0 diff --git a/list.sh b/list.sh index e8b7075..8b8ea8e 100644 --- a/list.sh +++ b/list.sh @@ -77,9 +77,12 @@ list_filemeta(){ | if [ "$FILTER" ]; then sed -nr "$list_fex" elif [ "${SEARCH#!}" != "${SEARCH}" ]; then - grep -aviE "$(STRING "${SEARCH#!}" |sed -r 's;((^|[^\\])(\\\\)*)\+;\1\\+;g;')" + grep -aviE "$(STRING "${SEARCH#!}" |sed -r ':x s;((^|[^\\])(\\\\)*)\+;\1\\+;g; tx;')" else - grep -aiE "$(STRING "${SEARCH}" |sed -r 's;((^|[^\\])(\\\\)*)\+;\1\\+;g;')" + grep -aiE "$(STRING "${SEARCH}" \ + | sed -r ':x s;((^|[^\\])(\\\\)*)\+;\1 ;g; tx; + s;((^|[^\\])(\\\\)*)\\\+;\1+;g; + s; ;\\+;g;')" fi |cut -f6 | UNSTRING \ | while read -r fn; do printf '%s\n' "${base}/${fn%${CR}}" @@ -90,7 +93,7 @@ list_index(){ local meta (cd "$_DATA/$ITEM"; find ./ -path '*/.index/meta' - ) | while meta="$(line)"; do + ) | while read -r meta; do list_filemeta "${meta%/.index/meta}" done } @@ -159,8 +162,9 @@ printf 'Content-Type: text/html;charset=utf-8\r\n\r\n' [a #t_avsearch href="#advsearch" Advanced] [a #t_prefs href="#prefs" ⚙] ]' - w_prefs + w_bookmarks w_advsearch + w_prefs printf ' [form method=POST action="?a=multitag"' list_items \