emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r106954: pcmpl-ssh-known-hosts tiny c


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r106954: pcmpl-ssh-known-hosts tiny change
Date: Fri, 27 Jan 2012 13:14:16 -0800
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 106954
fixes bug(s): http://debbugs.gnu.org/10533
author: Mike Lamb <address@hidden>
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Fri 2012-01-27 13:14:16 -0800
message:
  pcmpl-ssh-known-hosts tiny change
  
  * lisp/pcmpl-unix.el (pcmpl-ssh-known-hosts): Handle [host]:port syntax.
modified:
  lisp/ChangeLog
  lisp/pcmpl-unix.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-01-27 08:46:10 +0000
+++ b/lisp/ChangeLog    2012-01-27 21:14:16 +0000
@@ -1,3 +1,8 @@
+2012-01-27  Mike Lamb  <address@hidden>  (tiny change)
+
+       * pcmpl-unix.el (pcmpl-ssh-known-hosts):
+       Handle [host]:port syntax.  (Bug#10533)
+
 2012-01-27  Alex Harsanyi  <address@hidden>
 
        * xml.el (xml-parse-tag): Fix parsing of comments (Bug#10405).

=== modified file 'lisp/pcmpl-unix.el'
--- a/lisp/pcmpl-unix.el        2012-01-19 07:21:25 +0000
+++ b/lisp/pcmpl-unix.el        2012-01-27 21:14:16 +0000
@@ -152,13 +152,15 @@
              (file-readable-p pcmpl-ssh-known-hosts-file))
     (with-temp-buffer
       (insert-file-contents-literally pcmpl-ssh-known-hosts-file)
-      (let (ssh-hosts-list)
-        (while (re-search-forward "^ *\\([-.[:alnum:]]+\\)[, ]" nil t)
-          (add-to-list 'ssh-hosts-list (match-string 1))
+      (let ((host-re 
"\\(?:\\([-.[:alnum:]]+\\)\\|\\[\\([-.[:alnum:]]+\\)\\]:[0-9]+\\)[, ]")
+            ssh-hosts-list)
+        (while (re-search-forward (concat "^ *" host-re) nil t)
+          (add-to-list 'ssh-hosts-list (concat (match-string 1)
+                                               (match-string 2)))
           (while (and (looking-back ",")
-                      (re-search-forward "\\([-.[:alnum:]]+\\)[, ]"
-                                         (line-end-position) t))
-            (add-to-list 'ssh-hosts-list (match-string 1))))
+                      (re-search-forward host-re (line-end-position) t))
+            (add-to-list 'ssh-hosts-list (concat (match-string 1)
+                                                 (match-string 2)))))
         ssh-hosts-list))))
 
 (defun pcmpl-ssh-config-hosts ()


reply via email to

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