(password-cache-add): Only start one timer per key.
authorSimon Josefsson <jas@extundo.com>
Wed, 26 Jan 2005 23:03:12 +0000 (23:03 +0000)
committerSimon Josefsson <jas@extundo.com>
Wed, 26 Jan 2005 23:03:12 +0000 (23:03 +0000)
Reported by Derek Atkins <warlord@MIT.EDU>.

lisp/ChangeLog
lisp/password.el

index 40351a7..7987849 100644 (file)
@@ -1,3 +1,8 @@
+2005-01-27  Simon Josefsson  <jas@extundo.com>
+
+       * password.el (password-cache-add): Only start one timer per key.
+       Reported by Derek Atkins <warlord@MIT.EDU>.
+
 2005-01-26  Steve Youngs  <steve@sxemacs.org>
 
        * run-at-time.el: Removed.  It is no longer needed as
index 51ad078..7d10192 100644 (file)
@@ -115,11 +115,11 @@ user again."
   "Add password to cache.
 The password is removed by a timer after `password-cache-expiry'
 seconds."
-  (set (intern key password-data) password)
-  (when password-cache-expiry
+  (when (and password-cache-expiry (null (intern-soft key password-data)))
     (run-at-time password-cache-expiry nil
                 #'password-cache-remove
                 key))
+  (set (intern key password-data) password)
   nil)
 
 (provide 'password)