aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2014-04-24 18:07:27 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2014-04-24 18:07:27 +0200
commit562812fb642fcc03a0781fa49170dbb607a90f5b (patch)
treedd5d3cb83d2db03870e6efd95b76e4bcf5c4aaa9 /src
parentdmenu: hide output (diff)
downloadpassword-store-562812fb642fcc03a0781fa49170dbb607a90f5b.tar.xz
password-store-562812fb642fcc03a0781fa49170dbb607a90f5b.zip
find: proper segmenting of terms1.6
Diffstat (limited to 'src')
-rwxr-xr-xsrc/password-store.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/password-store.sh b/src/password-store.sh
index 657f0e5..c3824f9 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -343,9 +343,9 @@ cmd_find() {
echo "Usage: $PROGRAM $COMMAND pass-names..."
exit 1
fi
- local terms="$*"
- echo "Search Terms: $terms"
- tree -C -l --noreport -P "*${terms// /*|*}*" --prune --matchdirs --ignore-case "$PREFIX" | tail -n +2 | sed 's/\.gpg$//'
+ IFS="," eval 'echo "Search Terms: $*"'
+ local terms="*$(printf '%s*|*' "$@")"
+ tree -C -l --noreport -P "${terms%|*}" --prune --matchdirs --ignore-case "$PREFIX" | tail -n +2 | sed 's/\.gpg$//'
}
cmd_grep() {