[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: tiny patch to ange-ftp
From: |
Stefan Monnier |
Subject: |
Re: tiny patch to ange-ftp |
Date: |
Tue, 09 Aug 2005 19:47:03 -0400 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin) |
> ***************
> *** 2328,2335 ****
> ;; We cd and then use `ls' with no directory argument.
> ;; This works around a misfeature of some versions of netbsd ftpd.
> (unless (equal cmd1 ".")
> ! (setq result (ange-ftp-cd host user (nth 1 cmd) 'noerror)))
> ! (setq cmd1 cmd3)))
> ;; First argument is the remote name
> ((progn
> --- 2328,2340 ----
> ;; We cd and then use `ls' with no directory argument.
> ;; This works around a misfeature of some versions of netbsd ftpd.
> (unless (equal cmd1 ".")
> ! (setq result (ange-ftp-cd host user
> ! ;; Make sure the target to which
> ! ;; `cd' is performed is a directory.
> ! (file-name-directory (nth 1 cmd))
> ! 'noerror)))
> ! ;; Concatenate the switches and the target to be used with `ls'.
> ! (setq cmd1 (concat "\"" cmd3 " " cmd1 "\""))))
> ;; First argument is the remote name
> ((progn
This looks wrong to me. NetBSD's ftpd does not accept two arguments to the
LS command, last I tried. Concatenating them and enclosing them in double
quotes won't make any difference either: it'll just consider that you want
to see the listing of the "-alF /foo" directory which probably
doesn't exist.
> ***************
> *** 3122,3129 ****
> (rest (substring name (match-end 0)))
> (dir (ange-ftp-expand-dir host user tilda)))
> (if dir
> ! (setq name (if (string-equal dir "/")
> ! rest (concat dir rest)))
> (error "User \"%s\" is not known"
> (substring tilda 1)))))
> --- 3127,3138 ----
> (rest (substring name (match-end 0)))
> (dir (ange-ftp-expand-dir host user tilda)))
> (if dir
> ! (setq name (cond ((string-equal rest "")
> ! dir)
> ! ((string-equal dir "/")
> ! rest)
> ! (t
> ! (concat dir rest))))
> (error "User \"%s\" is not known"
> (substring tilda 1)))))
This looks OK, tho maybe it's worth trying to figure out whether it's
correct for `rest' to be empty here or whether it is the symptom of
another bug. If this patch is the right fix, then it should include
a comment explaining why and in which case `rest' can be empty.
Stefan