From 5daf632af9b78042531631ce1ab6716a3b678de0 Mon Sep 17 00:00:00 2001 From: Svend Sorensen Date: Wed, 30 Sep 2015 14:48:03 -0700 Subject: emacs: Guard against "%" in message string The output of pass may contain "%", which will cause `message` to throw the error: "Not enough arguments for format string". For example, `pass rename foo bar` outputs: [master c33f7a9] Rename foo to bar. 1 file changed, 0 insertions(+), 0 deletions(-) rename foo.gpg => bar.gpg (100%) --- contrib/emacs/password-store.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'contrib/emacs') diff --git a/contrib/emacs/password-store.el b/contrib/emacs/password-store.el index 035cc08..79aa4f3 100644 --- a/contrib/emacs/password-store.el +++ b/contrib/emacs/password-store.el @@ -204,14 +204,14 @@ after `password-store-timeout' seconds." Separate multiple IDs with spaces." (interactive (list (read-string "GPG ID: "))) - (message (password-store--run-init (split-string gpg-id)))) + (message "%s" (password-store--run-init (split-string gpg-id)))) ;;;###autoload (defun password-store-insert (entry password) "Insert a new ENTRY containing PASSWORD." (interactive (list (read-string "Password entry: ") (read-passwd "Password: " t))) - (message (shell-command-to-string (format "echo %s | %s insert -m -f %s" + (message "%s" (shell-command-to-string (format "echo %s | %s insert -m -f %s" (shell-quote-argument password) password-store-executable (shell-quote-argument entry))))) @@ -234,20 +234,20 @@ Default PASSWORD-LENGTH is `password-store-password-length'." (defun password-store-remove (entry) "Remove existing password for ENTRY." (interactive (list (password-store--completing-read))) - (message (password-store--run-remove entry t))) + (message "%s" (password-store--run-remove entry t))) ;;;###autoload (defun password-store-rename (entry new-entry) "Rename ENTRY to NEW-ENTRY." (interactive (list (password-store--completing-read) (read-string "Rename entry to: "))) - (message (password-store--run-rename entry new-entry t))) + (message "%s" (password-store--run-rename entry new-entry t))) ;;;###autoload (defun password-store-version () "Show version of pass executable." (interactive) - (message (password-store--run-version))) + (message "%s" (password-store--run-version))) ;;;###autoload (defun password-store-url (entry) -- cgit v1.2.3