diff options
| author | Mike Lamb | 2012-01-27 13:14:16 -0800 |
|---|---|---|
| committer | Glenn Morris | 2012-01-27 13:14:16 -0800 |
| commit | 7dd37071d0a82f35507c6062bef0df2917564ab5 (patch) | |
| tree | ae79330730821aecc8578cf0e6beaf856101f7cc | |
| parent | 2aa43abb72cd52d01a83924c65a3cd855d5c75ed (diff) | |
| download | emacs-7dd37071d0a82f35507c6062bef0df2917564ab5.tar.gz emacs-7dd37071d0a82f35507c6062bef0df2917564ab5.zip | |
pcmpl-ssh-known-hosts tiny change
* lisp/pcmpl-unix.el (pcmpl-ssh-known-hosts): Handle [host]:port syntax.
Fixes: debbugs:10533
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/pcmpl-unix.el | 14 |
2 files changed, 13 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 571a5e284a2..a907bd43f38 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-01-27 Mike Lamb <mrlamb@gmail.com> (tiny change) | ||
| 2 | |||
| 3 | * pcmpl-unix.el (pcmpl-ssh-known-hosts): | ||
| 4 | Handle [host]:port syntax. (Bug#10533) | ||
| 5 | |||
| 1 | 2012-01-27 Alex Harsanyi <harsanyi@mac.com> | 6 | 2012-01-27 Alex Harsanyi <harsanyi@mac.com> |
| 2 | 7 | ||
| 3 | * xml.el (xml-parse-tag): Fix parsing of comments (Bug#10405). | 8 | * xml.el (xml-parse-tag): Fix parsing of comments (Bug#10405). |
diff --git a/lisp/pcmpl-unix.el b/lisp/pcmpl-unix.el index 2dc25d93abf..3af22c82dfb 100644 --- a/lisp/pcmpl-unix.el +++ b/lisp/pcmpl-unix.el | |||
| @@ -152,13 +152,15 @@ documentation), this function returns nil." | |||
| 152 | (file-readable-p pcmpl-ssh-known-hosts-file)) | 152 | (file-readable-p pcmpl-ssh-known-hosts-file)) |
| 153 | (with-temp-buffer | 153 | (with-temp-buffer |
| 154 | (insert-file-contents-literally pcmpl-ssh-known-hosts-file) | 154 | (insert-file-contents-literally pcmpl-ssh-known-hosts-file) |
| 155 | (let (ssh-hosts-list) | 155 | (let ((host-re "\\(?:\\([-.[:alnum:]]+\\)\\|\\[\\([-.[:alnum:]]+\\)\\]:[0-9]+\\)[, ]") |
| 156 | (while (re-search-forward "^ *\\([-.[:alnum:]]+\\)[, ]" nil t) | 156 | ssh-hosts-list) |
| 157 | (add-to-list 'ssh-hosts-list (match-string 1)) | 157 | (while (re-search-forward (concat "^ *" host-re) nil t) |
| 158 | (add-to-list 'ssh-hosts-list (concat (match-string 1) | ||
| 159 | (match-string 2))) | ||
| 158 | (while (and (looking-back ",") | 160 | (while (and (looking-back ",") |
| 159 | (re-search-forward "\\([-.[:alnum:]]+\\)[, ]" | 161 | (re-search-forward host-re (line-end-position) t)) |
| 160 | (line-end-position) t)) | 162 | (add-to-list 'ssh-hosts-list (concat (match-string 1) |
| 161 | (add-to-list 'ssh-hosts-list (match-string 1)))) | 163 | (match-string 2))))) |
| 162 | ssh-hosts-list)))) | 164 | ssh-hosts-list)))) |
| 163 | 165 | ||
| 164 | (defun pcmpl-ssh-config-hosts () | 166 | (defun pcmpl-ssh-config-hosts () |