Fix Bug#17653.

* net/tramp.el (tramp-ssh-controlmaster-options): Improve search regexp.
This commit is contained in:
Michael Albinus 2014-06-03 09:43:24 +02:00
parent e7477c9f9e
commit a336b2eae3
2 changed files with 10 additions and 4 deletions

View file

@ -1,3 +1,8 @@
2014-06-03 Michael Albinus <michael.albinus@gmx.de>
* net/tramp.el (tramp-ssh-controlmaster-options): Improve search
regexp. (Bug#17653)
2014-06-03 Glenn Morris <rgm@gnu.org>
* emacs-lisp/package.el (package-pinned-packages): Doc fix.

View file

@ -302,18 +302,19 @@ useful only in combination with `tramp-default-proxies-alist'.")
;;;###tramp-autoload
(defconst tramp-ssh-controlmaster-options
(let ((result ""))
(let ((result "")
(case-fold-search t))
(ignore-errors
(with-temp-buffer
(call-process "ssh" nil t nil "-o" "ControlMaster")
(goto-char (point-min))
(when (search-forward-regexp "Missing ControlMaster argument" nil t)
(when (search-forward-regexp "missing.+argument" nil t)
(setq result "-o ControlPath=%t.%%r@%%h:%%p -o ControlMaster=auto")))
(when result
(unless (zerop (length result))
(with-temp-buffer
(call-process "ssh" nil t nil "-o" "ControlPersist")
(goto-char (point-min))
(when (search-forward-regexp "Missing ControlPersist argument" nil t)
(when (search-forward-regexp "missing.+argument" nil t)
(setq result (concat result " -o ControlPersist=no"))))))
result)
"Call ssh to detect whether it supports the Control* arguments.