]> code.delx.au - gnu-emacs/commitdiff
(ange-ftp-parse-netrc-group): Don't move back to line
authorRichard M. Stallman <rms@gnu.org>
Sun, 31 Jul 1994 18:22:04 +0000 (18:22 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sun, 31 Jul 1994 18:22:04 +0000 (18:22 +0000)
beginning.  Skip the machine name whatever it may be.
(ange-ftp-parse-netrc): Skip initial whitespace.

lisp/ange-ftp.el

index 490682761915c40892efaae38405561af8cf182b..866d8f36dcc608233b195cd98aea607d246f377d 100644 (file)
@@ -851,7 +851,7 @@ SIZE, if supplied, should be a prime number."
 ;;;; Internal variables.
 ;;;; ------------------------------------------------------------
 
-(defconst ange-ftp-version "$Revision: 1.54 $")
+(defconst ange-ftp-version "$Revision: 1.55 $")
 
 (defvar ange-ftp-data-buffer-name " *ftp data*"
   "Buffer name to hold directory listing data received from ftp process.")
@@ -1157,12 +1157,22 @@ Optional DEFAULT is password to start with."
 ;; record the information found.
 
 (defun ange-ftp-parse-netrc-group ()
-  (beginning-of-line)
   (let ((start (point))
-       (end (progn (re-search-forward "machine\\|default"
-                                      (point-max) 'end 2) (point)))
+       (end (save-excursion
+              (if (looking-at "machine\\>")
+                  ;; Skip `machine' and the machine name that follows.
+                  (progn
+                    (skip-chars-forward "^ \t\n")
+                    (skip-chars-forward " \t\n")
+                    (skip-chars-forward "^ \t\n"))
+                ;; Skip `default'.
+                (skip-chars-forward "^ \t\n"))
+              ;; Find start of the next `machine' or `default'
+              ;; or the end of the buffer.
+              (if (re-search-forward "machine\\>\\|default\\>" nil t)
+                  (match-beginning 0)
+                (point-max))))
        machine login password account)
-    (goto-char start)
     (setq machine  (ange-ftp-parse-netrc-token "machine"  end)
          login    (ange-ftp-parse-netrc-token "login"    end)
          password (ange-ftp-parse-netrc-token "password" end)
@@ -1219,6 +1229,7 @@ Optional DEFAULT is password to start with."
                (mapcar 'funcall find-file-hooks)
                (setq buffer-file-name nil)
                (goto-char (point-min))
+               (skip-chars-forward " \t\n")
                (while (not (eobp))
                  (ange-ftp-parse-netrc-group))
                (kill-buffer (current-buffer)))