From 3df31c9f8b4565f043ba56409ec8d1bc0c12a211 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 2 Jul 2012 09:31:15 -0400 Subject: [PATCH] * lisp/net/ange-ftp.el (ange-ftp-expand-file-name): Use ange-ftp-ftp-name and file-name-absolute-p. (ange-ftp-file-exists-p): Use ange-ftp-file-exists-p for internal calls. --- lisp/ChangeLog | 9 ++++++++- lisp/net/ange-ftp.el | 26 ++++++++++---------------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cb09a630096..a514162e7ba 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2012-07-02 Stefan Monnier + + * net/ange-ftp.el (ange-ftp-expand-file-name): Use ange-ftp-ftp-name + and file-name-absolute-p. + (ange-ftp-file-exists-p): Use ange-ftp-file-exists-p for + internal calls. + 2012-07-02 Paul Eggert Spelling fixes. @@ -50,7 +57,7 @@ 2012-06-30 Stefan Monnier - * emacs-lisp/cl-lib.el: Require macroexp for its macros. + * emacs-lisp/cl-lib.el: Require macroexp. 2012-06-30 Chong Yidong diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index 478261d02d0..1d06a7fa729 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -3143,21 +3143,15 @@ logged in as user USER and cd'd to directory DIR." "Documented as `expand-file-name'." (save-match-data (setq default (or default default-directory)) - (cond ((eq (string-to-char name) ?~) - (ange-ftp-real-expand-file-name name)) - ((eq (string-to-char name) ?/) - (ange-ftp-canonize-filename name)) - ((and (eq system-type 'windows-nt) - (eq (string-to-char name) ?\\)) - (ange-ftp-canonize-filename name)) - ((and (eq system-type 'windows-nt) - (or (string-match "\\`[a-zA-Z]:" name) - (string-match "\\`[a-zA-Z]:" default))) - (ange-ftp-real-expand-file-name name default)) - ((zerop (length name)) - (ange-ftp-canonize-filename default)) - ((ange-ftp-canonize-filename - (concat (file-name-as-directory default) name)))))) + (cond + ((ange-ftp-ftp-name name) + ;; `default' is irrelevant. + (ange-ftp-canonize-filename name)) + ((file-name-absolute-p name) + ;; `name' is absolute but is not an ange-ftp name => not ange-ftp. + (ange-ftp-real-expand-file-name name "/")) + ((ange-ftp-canonize-filename + (concat (file-name-as-directory default) name)))))) ;;; These are problems--they are currently not enabled. @@ -3390,7 +3384,7 @@ system TYPE.") (if (ange-ftp-file-entry-p name) (let ((file-ent (ange-ftp-get-file-entry name))) (if (stringp file-ent) - (file-exists-p + (ange-ftp-file-exists-p (ange-ftp-expand-symlink file-ent (file-name-directory (directory-file-name name)))) -- 2.39.2