changeset 62017:10e0cd55b339

(rlogin): If there are option-like elements in the parsed args, take the host to be the first arg immediately following them.
author Thien-Thi Nguyen <ttn@gnuvola.org>
date Mon, 02 May 2005 02:41:57 +0000
parents ffdffaf33258
children 6539b66da8c3
files lisp/net/rlogin.el
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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))