spm

Personal fork of spm (simple password manager)

commit f78ad33df9dace384ef5596e2f6ca27720fecbcc
parent 2ac8d1947dab3f545fe42d910681dd0253cb79a3
Author: Klemens Nanni <kl3@posteo.org>
Date: Sun, 20 Nov 2016 02:52:50 +0100

Fix $ (regex) in entry names

'group/1$' denoting the exact file(s) named 'group/1.gpg', however using
the regular expression for line ending ($) would not work due to the
file ending. This commit corrects the user given expression to match the
actual file name.

This fixes #1[1].

1:	https://notabug.org/kl3/spm/issues/1
1 file changed, 1 insertion(+), 1 deletion(-)
M
spm.sh
|
2
+-
diff --git a/spm.sh b/spm.sh
@@ -55,7 +55,7 @@ readpw() {
 
 _find() {
 	find "${STORE_DIR}"/ \( -type f -o -type l \) -name \*.gpg \
-		| grep -G -i "${1}"
+		| grep -G -i "$(printf '%s' "${1}" | sed -e s/\$$/.gpg$/)"
 }
 
 view() {