]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix "password" detection in authinfo mode
authorLars Ingebrigtsen <larsi@gnus.org>
Sun, 22 Sep 2019 12:35:09 +0000 (14:35 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 22 Sep 2019 12:35:09 +0000 (14:35 +0200)
* lisp/auth-source.el (authinfo--hide-passwords): Ensure that we
only hit actual "password" entries and not "foo-password" and the
like.

lisp/auth-source.el

index 9669ae976ccea25e8cf59ed638bbc87720f17839..6d53a222e989f8c975ca184aec0abc697a7c9122 100644 (file)
@@ -2416,9 +2416,9 @@ passwords are revealed when point moved into the password.
     (save-restriction
       (narrow-to-region start end)
       (goto-char start)
-      (while (re-search-forward "\\bpassword +\\([^\n\t ]+\\)"
+      (while (re-search-forward "\\(\\s-\\|^\\)password\\s-+\\([^\n\t ]+\\)"
                                 nil t)
-        (let ((overlay (make-overlay (match-beginning 1) (match-end 1))))
+        (let ((overlay (make-overlay (match-beginning 2) (match-end 2))))
           (overlay-put overlay 'display (propertize "****"
                                                     'face 'warning))
           (overlay-put overlay 'reveal-toggle-invisible