[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
ange-ftp-insert-directory fights with ange-ftp-file-symlink-p
From: |
David Casperson |
Subject: |
ange-ftp-insert-directory fights with ange-ftp-file-symlink-p |
Date: |
Tue, 7 Dec 2004 13:28:08 -0800 (PST) |
In GNU Emacs 21.3.1 (sparc-sun-solaris2.8, X toolkit)
of 2003-05-25 on csfac007.unbc.ca
configured using `configure --prefix=/ld1/local'
Important settings:
value of $LC_ALL: nil
value of $LC_COLLATE: en_US.ISO8859-1
value of $LC_CTYPE: en_US.ISO8859-1
value of $LC_MESSAGES: C
value of $LC_MONETARY: en_US.ISO8859-1
value of $LC_NUMERIC: en_US.ISO8859-1
value of $LC_TIME: en_US.ISO8859-1
value of $LANG: en_US.ISO8859-1
locale-coding-system: iso-latin-1
default-enable-multibyte-characters: t
Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:
ange-ftp fails when you run find-file on an ange-ftp symlink to a
directory, where the symlink (on the remote machine) resolves to an
absolute path name. The problem occurs because both
ange-ftp-insert-directory and ange-ftp-file-symlink-p call
ange-ftp-replace-name-component, resulting in two copies of the /...:
part of the file-name.
The following patch seems to cure some of the problems.
*** /tmp/ange-ftp.el Tue Dec 7 13:18:09 2004 xxx fixed version
--- .../21.3/lisp/net/ange-ftp.el Tue Oct 22 01:14:33 2002
***************
*** 4340,4360 ****
tem)
(if parsed
(if (and (not wildcard)
(setq tem (file-symlink-p (directory-file-name file))))
(ange-ftp-insert-directory
! (if (not (ange-ftp-ftp-name tem))
! (ange-ftp-replace-name-component file tem)
! tem)
switches wildcard full)
(insert
(if wildcard
(let ((default-directory (file-name-directory file)))
(ange-ftp-ls (file-name-nondirectory file)
switches nil nil t))
(ange-ftp-ls file switches full))))
! (ange-ftp-real-insert-directory file switches wildcard full)))))
(defun ange-ftp-dired-uncache (dir)
(if (ange-ftp-ftp-name (expand-file-name dir))
(setq ange-ftp-ls-cache-file nil)))
--- 4340,4358 ----
tem)
(if parsed
(if (and (not wildcard)
(setq tem (file-symlink-p (directory-file-name file))))
(ange-ftp-insert-directory
! (ange-ftp-replace-name-component file tem)
switches wildcard full)
(insert
(if wildcard
(let ((default-directory (file-name-directory file)))
(ange-ftp-ls (file-name-nondirectory file)
switches nil nil t))
(ange-ftp-ls file switches full))))
! (ange-ftp-real-insert-directory file switches wildcard full)))))
(defun ange-ftp-dired-uncache (dir)
(if (ange-ftp-ftp-name (expand-file-name dir))
(setq ange-ftp-ls-cache-file nil)))
I have only tested this for a few cases using unix-to-unix ftp. I do
not understand the ange-ftp code well enough to know whether some of the
other uses of ange-ftp-replace-name-component may cause the same
bug. At least some of them seemed provably harmless.
David
--
Dr. David Casperson | casper@unbc.ca
Computer Science | x6672 Fax.5544
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- ange-ftp-insert-directory fights with ange-ftp-file-symlink-p,
David Casperson <=