From 7258e85c6bcfa8ed34bd8b6250dff244775ac525 Mon Sep 17 00:00:00 2001 From: sinanmohd Date: Wed, 2 Aug 2023 16:12:03 +0530 Subject: dbook: lazy evaluate value of keys --- dbook | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'dbook') diff --git a/dbook b/dbook index 3ea4128..126626c 100755 --- a/dbook +++ b/dbook @@ -109,19 +109,19 @@ parse_data() [ -z "$line" ] && continue _key="${line%%|*}" - _value="${line##*|}" _key="$(trim "$_key")" - _value="$(trim "$_value")" case "$_key" in #*) continue esac if [ "$1" = "getval" ]; then - if [ "$2" = "$_key" ]; then - echo "$_value" - return 0 - fi + [ "$2" != "$_key" ] && continue + + _value="${line##*|}" + _value="$(trim "$_value")" + echo "$_value" + return 0 else echo "$(load_icon "$_value")" "$_key" fi -- cgit v1.2.3