emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tiny patch to ange-ftp


From: Juri Linkov
Subject: Re: tiny patch to ange-ftp
Date: Wed, 10 Aug 2005 12:17:28 +0300
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

> 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.

Is NetBSD's ftpd the same program as lukemftpd?  Debian GNU/Linux has a
description confirming that:

  Package: lukemftpd
  Description: The enhanced ftp daemon from NetBSD.
   `lukemftpd' is what many users affectionately call the enhanced ftp
   server in NetBSD (http://www.netbsd.org).  The `lukem' comes from
   the account name of the NetBSD developer who wrote most of the
   enhancements: Luke Mewburn <address@hidden>.

The patch below fixes ange-ftp.el to work with both ProFTPD and
lukemftpd (which is seemingly is the same as netbsd ftpd).

This is not a final patch: I like to test it more before installing.

Index: lisp/net/ange-ftp.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/net/ange-ftp.el,v
retrieving revision 1.70
diff -c -r1.70 ange-ftp.el
*** lisp/net/ange-ftp.el        9 Aug 2005 21:00:39 -0000       1.70
--- lisp/net/ange-ftp.el        10 Aug 2005 08:31:00 -0000
***************
*** 2327,2340 ****
        (setq cmd0 'ls)
        ;; 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
--- 2327,2352 ----
        (setq cmd0 'ls)
        ;; We cd and then use `ls' with no directory argument.
        ;; This works around a misfeature of some versions of netbsd ftpd.
!         (or (equal cmd3 "")
!           (setq cmd1 (format "\"%s %s\"" cmd3 cmd1)))))
  
       ;; First argument is the remote name
       ((progn
***************
*** 2650,2656 ****
                          ;; `DIR /some/file/.' which leads ange-ftp to
                          ;; believe that /some/file is a directory ;-(
                          nil
!                       ange-ftp-ls-cache-res))
                  (if no-error
                      nil
                    (ange-ftp-error host user
--- 2662,2674 ----
                          ;; `DIR /some/file/.' which leads ange-ftp to
                          ;; believe that /some/file is a directory ;-(
                          nil
!                       (if (and (equal ange-ftp-ls-cache-res "")
!                                (not (equal lsargs "")))
!                           ;; lukemftpd returns an empty file-listing
!                           ;; when using non-empty lsargs.  So try
!                           ;; without ls arguments.
!                           (ange-ftp-ls file "" parse no-error wildcard)
!                         ange-ftp-ls-cache-res)))
                  (if no-error
                      nil
                    (ange-ftp-error host user

-- 
Juri Linkov
http://www.jurta.org/emacs/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]