(auth-source-netrc-parse): Accept a number as the port spec, too.
authorLars Ingebrigtsen <larsi@gnus.org>
Mon, 21 Feb 2011 23:58:25 +0000 (15:58 -0800)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 21 Feb 2011 23:58:25 +0000 (15:58 -0800)
lisp/ChangeLog
lisp/auth-source.el

index 0b890be..ef81f60 100644 (file)
@@ -1,5 +1,9 @@
 2011-02-21  Lars Ingebrigtsen  <larsi@gnus.org>
 
+       * auth-source.el (auth-source-netrc-parse): Accept a number as the port
+       spec, too.
+       (auth-source-ensure-strings): New function.
+
        * gnus-art.el (gnus-article-update-date-headers): Doc fix.
        (gnus-article-setup-buffer): Always restart the date timer so that user
        changes to the frequency is respected.
index 3fe31b5..d53ffe6 100644 (file)
@@ -690,6 +690,15 @@ while \(:host t) would find all host entries."
 
 ;;; Backend specific parsing: netrc/authinfo backend
 
+(defun auth-source-ensure-strings (values)
+  (unless (listp values)
+    (setq values (list values)))
+  (mapcar (lambda (value)
+           (if (numberp value)
+               (format "%s" value)
+             port))
+         values))
+
 (defvar auth-source-netrc-cache nil)
 
 ;;; (auth-source-netrc-parse "~/.authinfo.gpg")
@@ -703,6 +712,7 @@ Note that the MAX parameter is used so we can exit the parse early."
       ;; We got already parsed contents; just return it.
       file
     (when (file-exists-p file)
+      (setq port (auth-source-ensure-strings port))
       (with-temp-buffer
         (let ((tokens '("machine" "host" "default" "login" "user"
                         "password" "account" "macdef" "force"