From: Paul Hänsch Date: Mon, 18 Jan 2021 12:30:45 +0000 (+0100) Subject: Bugfix: avoid search hits in subsequent fields X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=d62152dd1da767031ca421064a826964952cef77;p=lobster Bugfix: avoid search hits in subsequent fields --- 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