From d62152dd1da767031ca421064a826964952cef77 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Mon, 18 Jan 2021 13:30:45 +0100 Subject: [PATCH] Bugfix: avoid search hits in subsequent fields --- cards/list.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cards/list.sh b/cards/list.sh index 74ad020..8b9cd06 100755 --- a/cards/list.sh +++ b/cards/list.sh @@ -128,21 +128,23 @@ filter_cards(){ | sed -E 's;[]\/\(\)\\\$\?\.\+\*\;\[\{\}];\\\\&;g; '"$upcase" )^" + debug "FILTER: $filter" while [ "$filter" ]; do f="${filter%%^*}" filter="${filter#*^}" case $f in '') break ;; - ANY:*) fex="/\n.*(\;[^:]*)?:.*(${f#*:}).*\r?\n/{${fex}}" + ANY:*) fex="/\n.*(\;[^:]*)?:[^\n]*(${f#*:})[^\n]*\r?\n/{${fex}}" ;; - NAME:*) fex="/\n(N|FN|NICKNAME)(\;[^:]*)?:.*(${f#*:}).*\r?\n/{${fex}}" + NAME:*) fex="/\n(N|FN|NICKNAME)(\;[^:]*)?:[^\n]*(${f#*:})[^\n]*\r?\n/{${fex}}" ;; - STREET:*|ZIP:*) fex="/\nADR(\;[^:]*)?:.*(${f#*:}).*\r?\n/{${fex}}" + STREET:*|ZIP:*) fex="/\nADR(\;[^:]*)?:[^\n]*(${f#*:})[^\n]*\r?\n/{${fex}}" ;; - *) fex="/\n${f%%:*}(\;[^:]*)?:.*(${f#*:}).*\r?\n/{${fex}}" + *) fex="/\n${f%%:*}(\;[^:]*)?:[^\n]*(${f#*:})[^\n]*\r?\n/{${fex}}" ;; esac + debug "FEX: $fex" done for cardfile in "${_DATA}"/vcard/*.vcf; do -- 2.39.2