emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/bluetooth 0108cbd 32/57: uses `read-from-minibuffer' in


From: Stefan Monnier
Subject: [elpa] externals/bluetooth 0108cbd 32/57: uses `read-from-minibuffer' instead of `read-passwd'
Date: Thu, 7 Nov 2019 23:28:54 -0500 (EST)

branch: externals/bluetooth
commit 0108cbde29366f88b333152ce31da0e23c1156aa
Author: Raffael Stocker <address@hidden>
Commit: Raffael Stocker <address@hidden>

    uses `read-from-minibuffer' instead of `read-passwd'
    
    The pin is not encrypted on the bus, so it makes no sense to hide it in the
    user interface.
---
 bluetooth.el | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/bluetooth.el b/bluetooth.el
index 3123389..2b77d25 100644
--- a/bluetooth.el
+++ b/bluetooth.el
@@ -440,19 +440,17 @@ This function only uses the first adapter reported by 
Bluez."
   (bluetooth--maybe-cancel-reject
     (bluetooth--with-alias device
       (save-match-data
-       (let* ((pin (read-passwd (format "Enter Bluetooth PIN for `%s': " 
alias)))
+       (let* ((pin (read-from-minibuffer
+                    (format "Enter Bluetooth PIN for `%s': " alias)))
               (trimmed-pin (substring pin 0 (min (length pin) 16)))
               (case-fold-search nil))
-         (unwind-protect
-             (cond ((= 0 (length trimmed-pin))
-                    (message "PIN has zero length")
-                    nil)
-                   ((string-match "[^[:alnum:]]" trimmed-pin)
-                    (message "PIN contains non-alphanumeric characters")
-                    nil)
-                   (t trimmed-pin))
-           (clear-string pin)
-           (clear-string trimmed-pin)))))))
+         (cond ((= 0 (length trimmed-pin))
+                (message "PIN has zero length")
+                nil)
+               ((string-match "[^[:alnum:]]" trimmed-pin)
+                (message "PIN contains non-alphanumeric characters")
+                nil)
+               (t trimmed-pin)))))))
 
 (defun bluetooth--display-pin-code (device pincode)
   "Display the PINCODE for DEVICE."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]