From a6d47d63a2ae5495d06c4514be273d5168b71855 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Mon, 16 Jul 2018 12:22:05 +0200 Subject: [PATCH] minor optimisations --- cgilite | 2 +- list.sh | 4 ++-- widgets.sh | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cgilite b/cgilite index 318867d..55052a1 160000 --- a/cgilite +++ b/cgilite @@ -1 +1 @@ -Subproject commit 318867de22a49dc1e348cc1173ee4cdeb977d7b1 +Subproject commit 55052a16e5c2792b25c90b8aea0e3daea06b533a diff --git a/list.sh b/list.sh index 607ea20..52b78b2 100644 --- a/list.sh +++ b/list.sh @@ -69,7 +69,7 @@ list_items() { if [ "$mode" = browse -a "$ORDER" = Date ]; then list_directories list_filemeta . |cut -f2- \ - | xargs -d\n stat -c '%Y %n' \ + | xargs -rd'\n' stat -c '%Y %n' \ | sort -rn |cut -d/ -f2- elif [ "$mode" = browse -a "$ORDER" = Name ]; then list_directories @@ -77,7 +77,7 @@ list_items() { | sort -k 2 |cut -d/ -f2- elif [ "$mode" = index -a "$ORDER" = Date ]; then list_index |cut -f2- \ - | xargs -d'\n' stat -c '%Y %n' \ + | xargs -rd'\n' stat -c '%Y %n' \ | sort -rn | cut -d/ -f2- elif [ "$mode" = index -a "$ORDER" = Name ]; then list_index | sort -k 2 | cut -d/ -f2- diff --git a/widgets.sh b/widgets.sh index bb3ac22..5cc4db9 100644 --- a/widgets.sh +++ b/widgets.sh @@ -5,7 +5,8 @@ include_widgets="$0" . "$_EXEC/cgilite/storage.sh" -w_tags="$(find "$_DATA/" -path '*/.index/meta' -exec cut -f4 '{}' + \ +w_tags="$(find "$_DATA/" -path '*/.index/meta' -print0 \ + | xargs -r0 cut -f4 \ | cut -d= -f2- |tr , '\n' | sort -u)" w_tags="$(UNSTRING "$w_tags")" -- 2.39.2