Switch to recommended form of GPLv3 permissions notice.
[bpt/emacs.git] / lisp / net / rlogin.el
index a69a51d..763b09d 100644 (file)
@@ -1,19 +1,18 @@
 ;;; rlogin.el --- remote login interface
 
-;; Copyright (C) 1992, 93, 94, 95, 97, 1998, 2002 Free Software Foundation, Inc.
+;; Copyright (C) 1992, 1993, 1994, 1995, 1997, 1998, 2001, 2002, 2003,
+;;   2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
 ;; Author: Noah Friedman
 ;; Maintainer: Noah Friedman <friedman@splode.com>
 ;; Keywords: unix, comm
 
-;; $Id: rlogin.el,v 1.5 2003/09/01 15:45:33 miles Exp $
-
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -21,9 +20,7 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
@@ -43,7 +40,7 @@
 (require 'shell)
 
 (defgroup rlogin nil
-  "Remote login interface"
+  "Remote login interface."
   :group 'processes
   :group 'unix)
 
@@ -181,10 +178,15 @@ variable."
 
   (let* ((process-connection-type rlogin-process-connection-type)
          (args (if rlogin-explicit-args
-                   (append (rlogin-parse-words input-args)
+                   (append (split-string input-args)
                            rlogin-explicit-args)
-                 (rlogin-parse-words input-args)))
-        (host (car args))
+                 (split-string input-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))
@@ -283,19 +285,6 @@ local one share the same directories (through NFS)."
           (goto-char orig-point)))))))
 
 \f
-;; Parse a line into its constituent parts (words separated by
-;; whitespace).  Return a list of the words.
-(defun rlogin-parse-words (line)
-  (let ((list nil)
-       (posn 0)
-        (match-data (match-data)))
-    (while (string-match "[^ \t\n]+" line posn)
-      (setq list (cons (substring line (match-beginning 0) (match-end 0))
-                       list))
-      (setq posn (match-end 0)))
-    (set-match-data (match-data))
-    (nreverse list)))
-
 (defun rlogin-send-Ctrl-C ()
   (interactive)
   (process-send-string nil "\C-c"))
@@ -329,5 +318,5 @@ Delete ARG characters forward, or send a C-d to process if at end of buffer."
 
 (provide 'rlogin)
 
-;;; arch-tag: 6e20eabf-feda-40fa-ab40-0d156db447e4
+;; arch-tag: 6e20eabf-feda-40fa-ab40-0d156db447e4
 ;;; rlogin.el ends here