From: David Casperson <casper@unbc.ca>
Subject: ange-ftp-insert-directory fights with ange-ftp-file-symlink-p
Date: Tue, 7 Dec 2004 13:28:08 -0800 (PST) [thread overview]
Message-ID: <Pine.GSO.4.58.0412071303300.1026@csfac007.unbc.ca> (raw)
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
reply other threads:[~2004-12-07 21:28 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.GSO.4.58.0412071303300.1026@csfac007.unbc.ca \
--to=casper@unbc.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).