aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-06-07 17:58:32 +0000
committerRichard M. Stallman1994-06-07 17:58:32 +0000
commit23553df06a6c703e240268e31a0c217ae7d51e8d (patch)
tree154145c39f9937dae905de7f3833142d3c2c048e
parent8e91f4415129bc56dac08866d24ad4829e8bb651 (diff)
downloademacs-23553df06a6c703e240268e31a0c217ae7d51e8d.tar.gz
emacs-23553df06a6c703e240268e31a0c217ae7d51e8d.zip
(ange-ftp-canonize-filename): Preserve // after colon.
(ange-ftp-expand-file-name): Likewise. (ange-ftp-canonize-filename): Preserve // at very beginning.
-rw-r--r--lisp/ange-ftp.el19
1 files changed, 10 insertions, 9 deletions
diff --git a/lisp/ange-ftp.el b/lisp/ange-ftp.el
index 174279ed52e..33c9b460e97 100644
--- a/lisp/ange-ftp.el
+++ b/lisp/ange-ftp.el
@@ -851,7 +851,7 @@ SIZE, if supplied, should be a prime number."
851;;;; Internal variables. 851;;;; Internal variables.
852;;;; ------------------------------------------------------------ 852;;;; ------------------------------------------------------------
853 853
854(defconst ange-ftp-version "$Revision: 1.52 $") 854(defconst ange-ftp-version "$Revision: 1.53 $")
855 855
856(defvar ange-ftp-data-buffer-name " *ftp data*" 856(defvar ange-ftp-data-buffer-name " *ftp data*"
857 "Buffer name to hold directory listing data received from ftp process.") 857 "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."
2748 2748
2749(defun ange-ftp-canonize-filename (n) 2749(defun ange-ftp-canonize-filename (n)
2750 "Take a string and short-circuit //, /. and /.." 2750 "Take a string and short-circuit //, /. and /.."
2751 (if (string-match ".+//" n) ;don't upset Apollo users 2751 (if (string-match "[^:]+//" n) ;don't upset Apollo users
2752 (setq n (substring n (1- (match-end 0))))) 2752 (setq n (substring n (1- (match-end 0)))))
2753 (let ((parsed (ange-ftp-ftp-name n))) 2753 (let ((parsed (ange-ftp-ftp-name n)))
2754 (if parsed 2754 (if parsed
@@ -2783,12 +2783,13 @@ logged in as user USER and cd'd to directory DIR."
2783 name)) 2783 name))
2784 (error "Unable to obtain CWD"))))) 2784 (error "Unable to obtain CWD")))))
2785 2785
2786 (setq name (ange-ftp-real-expand-file-name name)) 2786 ;; If name starts with //, preserve that, for apollo system.
2787 2787 (if (not (string-match "^//" path))
2788 ;; see if hit real expand-file-name bug... this will probably annoy 2788 (progn
2789 ;; some Apollo people. I'll wait until they shout, however. 2789 (setq path (ange-ftp-real-expand-file-name path))
2790 (if (string-match "^//" name) 2790
2791 (setq name (substring name 1))) 2791 (if (string-match "^//" path)
2792 (setq path (substring path 1)))))
2792 2793
2793 ;; Now substitute the expanded name back into the overall filename. 2794 ;; Now substitute the expanded name back into the overall filename.
2794 (ange-ftp-replace-name-component n name)) 2795 (ange-ftp-replace-name-component n name))
@@ -2804,7 +2805,7 @@ logged in as user USER and cd'd to directory DIR."
2804 "Documented as original." 2805 "Documented as original."
2805 (ange-ftp-save-match-data 2806 (ange-ftp-save-match-data
2806 (if (eq (string-to-char name) ?/) 2807 (if (eq (string-to-char name) ?/)
2807 (while (cond ((string-match ".+//" name) ;don't upset Apollo users 2808 (while (cond ((string-match "[^:]+//" name) ;don't upset Apollo users
2808 (setq name (substring name (1- (match-end 0))))) 2809 (setq name (substring name (1- (match-end 0)))))
2809 ((string-match "/~" name) 2810 ((string-match "/~" name)
2810 (setq name (substring name (1- (match-end 0)))))))) 2811 (setq name (substring name (1- (match-end 0))))))))