aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rwxr-xr-xlib/keyringer/actions/find2
-rwxr-xr-xlib/keyringer/functions2
3 files changed, 4 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 742307c..c068f9c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
2014-04-11 - Silvio Rhatto <rhatto@riseup.net>
+ Find: rollback: use find+grep instead of 'find -iname' (#53)
+
Edit/open: wait for background process to finish (#49)
Edit: use encrypt action
diff --git a/lib/keyringer/actions/find b/lib/keyringer/actions/find
index 21afc7a..9b18d66 100755
--- a/lib/keyringer/actions/find
+++ b/lib/keyringer/actions/find
@@ -15,5 +15,5 @@ shift
ARGS="`echo "$*" | sed -e "s|^/*||"`"
# Run find command
-cd "$KEYDIR/$RELATIVE_PATH" && find -iname "*$ARGS*" | sed -e 's|^./||g'
+cd "$KEYDIR/$RELATIVE_PATH" && find | grep -i "$ARGS" | sed -e 's|^./||g'
cd "$CWD"
diff --git a/lib/keyringer/functions b/lib/keyringer/functions
index ad18f44..59777d0 100755
--- a/lib/keyringer/functions
+++ b/lib/keyringer/functions
@@ -436,7 +436,7 @@ function keyringer_get_file {
elif [ ! -f "$KEYDIR/$FILE" ]; then
# Try to find a similar file
count=0
- candidates=(`keyringer_exec find "$BASEDIR" "$1*.asc"`)
+ candidates=(`keyringer_exec find "$BASEDIR" | grep -i "$1" | grep -e '.asc$'`)
if [ ! -z "$candidates" ]; then
echo "Could not find exact match for \"$1\", please choose one of the following secrets:"