summaryrefslogtreecommitdiff
path: root/lisp/net/rlogin.el
diff options
context:
space:
mode:
authorThien-Thi Nguyen <ttn@gnuvola.org>2005-05-02 02:45:39 +0000
committerThien-Thi Nguyen <ttn@gnuvola.org>2005-05-02 02:45:39 +0000
commit9a4798350aedb99a6ec498b92b577c9d8555d9eb (patch)
tree089ef57dcfe45e17d9366efb291ff73726f18755 /lisp/net/rlogin.el
parent19a31306a06a28308bc6f38a2c6ccd81aa5235ce (diff)
downloademacs-9a4798350aedb99a6ec498b92b577c9d8555d9eb.tar.gz
(rlogin): If there are option-like elements in the parsed args,
take the host to be the first arg immediately following them.
Diffstat (limited to 'lisp/net/rlogin.el')
-rw-r--r--lisp/net/rlogin.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/net/rlogin.el b/lisp/net/rlogin.el
index b49e5bde10c..67521ca2e73 100644
--- a/lisp/net/rlogin.el
+++ b/lisp/net/rlogin.el
@@ -182,7 +182,12 @@ variable."
(append (split-string input-args)
rlogin-explicit-args)
(split-string input-args)))
- (host (car args))
+ (host (let ((tail args))
+ ;; Find first arg that doesn't look like an option.
+ ;; This still loses for args that take values, feh.
+ (while (and tail (= ?- (aref (car tail) 0)))
+ (setq tail (cdr tail)))
+ (car tail)))
(user (or (car (cdr (member "-l" args)))
(user-login-name)))
(buffer-name (if (string= user (user-login-name))