From 6bb594802588240405efee0813f7aa1daa9648b3 Mon Sep 17 00:00:00 2001 From: lolilolicon Date: Thu, 29 Sep 2011 10:45:22 +0800 Subject: paccache: proper quoting in [[ expression ]] Always quote the right-hand side of expression when the == or != operator is used, unless intended as a pattern. Signed-off-by: lolilolicon Signed-off-by: Dave Reisner --- contrib/paccache.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/paccache.in b/contrib/paccache.in index e5cac7de..4e185c27 100755 --- a/contrib/paccache.in +++ b/contrib/paccache.in @@ -153,7 +153,7 @@ summarize() { while read -r pkg; do if (( verbose >= 3 )); then [[ $pkg =~ $pkg_re ]] && name=${BASH_REMATCH[1]} arch=${BASH_REMATCH[2]} - if [[ -z $seen || $seenarch != $arch || $seen != $name ]]; then + if [[ -z $seen || $seenarch != "$arch" || $seen != "$name" ]]; then printf '%s (%s):\n' "$name" "$arch" fi printf ' %s\n' "$pkg" -- cgit v1.2.3-24-g4f1b