]> git.eshelyaron.com Git - emacs.git/commitdiff
(ange-ftp-canonize-filename): Preserve // after colon.
authorRichard M. Stallman <rms@gnu.org>
Tue, 7 Jun 1994 17:58:32 +0000 (17:58 +0000)
committerRichard M. Stallman <rms@gnu.org>
Tue, 7 Jun 1994 17:58:32 +0000 (17:58 +0000)
(ange-ftp-expand-file-name): Likewise.
(ange-ftp-canonize-filename): Preserve // at very beginning.

lisp/ange-ftp.el

index 174279ed52e864234c16708335e25dc5ebbac7d0..33c9b460e97b653f7d64f4336d2a87ac576bd06b 100644 (file)
@@ -851,7 +851,7 @@ SIZE, if supplied, should be a prime number."
 ;;;; Internal variables.
 ;;;; ------------------------------------------------------------
 
-(defconst ange-ftp-version "$Revision: 1.52 $")
+(defconst ange-ftp-version "$Revision: 1.53 $")
 
 (defvar ange-ftp-data-buffer-name " *ftp data*"
   "Buffer name to hold directory listing data received from ftp process.")
@@ -2748,7 +2748,7 @@ logged in as user USER and cd'd to directory DIR."
 
 (defun ange-ftp-canonize-filename (n)
   "Take a string and short-circuit //, /. and /.."
-  (if (string-match ".+//" n)          ;don't upset Apollo users
+  (if (string-match "[^:]+//" n)               ;don't upset Apollo users
       (setq n (substring n (1- (match-end 0)))))
   (let ((parsed (ange-ftp-ftp-name n)))
     (if parsed
@@ -2783,12 +2783,13 @@ logged in as user USER and cd'd to directory DIR."
                                   name))
                     (error "Unable to obtain CWD")))))
          
-         (setq name (ange-ftp-real-expand-file-name name))
-         
-         ;; see if hit real expand-file-name bug...  this will probably annoy
-         ;; some Apollo people.  I'll wait until they shout, however.
-         (if (string-match "^//" name)
-             (setq name (substring name 1)))
+         ;; If name starts with //, preserve that, for apollo system.
+         (if (not (string-match "^//" path))
+             (progn
+               (setq path (ange-ftp-real-expand-file-name path))
+
+               (if (string-match "^//" path)
+                   (setq path (substring path 1)))))
          
          ;; Now substitute the expanded name back into the overall filename.
          (ange-ftp-replace-name-component n name))
@@ -2804,7 +2805,7 @@ logged in as user USER and cd'd to directory DIR."
   "Documented as original."
   (ange-ftp-save-match-data
     (if (eq (string-to-char name) ?/)
-       (while (cond ((string-match ".+//" name) ;don't upset Apollo users
+       (while (cond ((string-match "[^:]+//" name) ;don't upset Apollo users
                      (setq name (substring name (1- (match-end 0)))))
                     ((string-match "/~" name)
                      (setq name (substring name (1- (match-end 0))))))))