# HG changeset patch # User Thien-Thi Nguyen # Date 1115001717 0 # Node ID 10e0cd55b339c538bac208a3b644fc89589cb613 # Parent ffdffaf3325849a71da8d8d7bfc934ced8ec418b (rlogin): If there are option-like elements in the parsed args, take the host to be the first arg immediately following them. diff -r ffdffaf33258 -r 10e0cd55b339 lisp/net/rlogin.el --- a/lisp/net/rlogin.el Mon May 02 02:34:57 2005 +0000 +++ b/lisp/net/rlogin.el Mon May 02 02:41:57 2005 +0000 @@ -182,7 +182,12 @@ (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))