From 37b2109f3cef4f3d8c37ce55ff173234cd9c549f Mon Sep 17 00:00:00 2001 From: paul Date: Sat, 15 Aug 2015 19:10:30 +0000 Subject: [PATCH] avoid filtering with empty filters svn path=/trunk/; revision=82 --- pages/common.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pages/common.sh b/pages/common.sh index cf05491..e03e6f5 100755 --- a/pages/common.sh +++ b/pages/common.sh @@ -112,13 +112,16 @@ thumblist() { genlist \ | if [ -n "$search" ] ; then + debug "Applying search: ${search}" xargs -d '\n' printf "${_DATA}/meta/%s.meta\n" \ | xargs -d '\n' egrep -sil "$search" \ | sed -r 's;^.*/;;;s;\.meta$;;' - elif [ "$filterex" != "q0" ]; then + elif [ -n "$filter" ]; then + debug "Applying filters: ${filter} ++ ${filterex}" xargs -d '\n' printf "${_DATA}/meta/%s.meta\n" \ | xargs -d '\n' sed -srn ":a;N;2!ba;{${filterex}}" else + debug "No search or filtering" cat fi \ | sed -n "$page,$(($page + $pagesize - 1))p" \ -- 2.39.2