From 9a4798350aedb99a6ec498b92b577c9d8555d9eb Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Mon, 2 May 2005 02:45:39 +0000 Subject: [PATCH] (rlogin): If there are option-like elements in the parsed args, take the host to be the first arg immediately following them. --- lisp/ChangeLog | 9 +++++++++ lisp/net/rlogin.el | 7 ++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1fed88f666d..daa3ba63d66 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,8 +1,17 @@ +2005-05-02 Thien-Thi Nguyen + + * net/rlogin.el (rlogin-parse-words): Delete func. + (rlogin): Use split-string, not rlogin-parse-words. + Also, if there are option-like elements in the parsed args, + take the host to be the first arg immediately following them. + Suggested by Michael Mauger. + 2005-05-01 Luc Teirlinck * subr.el (executing-macro): Use `define-obsolete-variable-alias'. 2005-05-02 Nick Roberts + * progmodes/cc-mode.el (cc-create-define-alist): Use a shell. (cc-mode-cpp-program): Rename to cc-define-list-program and move to cc-vars.el. 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)) -- 2.39.2