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

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

Re: ange-ftp problem


From: Michael Albinus
Subject: Re: ange-ftp problem
Date: Sat, 31 Jan 2004 19:29:39 +0100
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

> But ange-ftp doesn't know how to do that.  It is indeed due to the change
> that Michael pointed out: we turn `ls -ald <path>' into `cd <path>;
> ls -ald' which of course only works if <path> is a directory.

For me, the following patch works (wu-ftpd 2.6.2, sorry no netbsd ftpd):

magdalene:~/src/emacs/lisp/net> diff -u ange-ftp.el.~1.56.~ ange-ftp.el
--- ange-ftp.el.~1.56.~ 2004-01-05 22:13:57.000000000 +0100
+++ ange-ftp.el 2004-01-31 19:14:54.000000000 +0100
@@ -2298,7 +2298,8 @@
        ;; 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)))
+       (unless (and (consp result) (null (car result)))
+         (setq cmd1 cmd3))))
 
      ;; First argument is the remote name
      ((progn
@@ -2324,37 +2325,34 @@
                      (and cmd2 (concat " " cmd2))))
 
     ;; Actually send the resulting command.
-    (if (and (consp result) (null (car result)))
-       ;; `ange-ftp-cd' has failed, so there's no point sending `cmd'.
-       result
-      (let (afsc-result
-           afsc-line)
-       (ange-ftp-raw-send-cmd
-        (ange-ftp-get-process host user)
-        cmd
-        msg
-        (list (lambda (result line host user cmd msg cont nowait)
-                (or cont (setq afsc-result result
-                               afsc-line line))
-                (if result (ange-ftp-call-cont cont result line)
-                   (ange-ftp-raw-send-cmd
-                    (ange-ftp-get-process host user)
-                    cmd
-                    msg
-                    (list (lambda (result line cont)
-                            (or cont (setq afsc-result result
-                                           afsc-line line))
-                            (ange-ftp-call-cont cont result line))
-                          cont)
-                   nowait)))
-              host user cmd msg cont nowait)
-        nowait)
-
-       (if nowait
+    (let (afsc-result
+         afsc-line)
+      (ange-ftp-raw-send-cmd
+       (ange-ftp-get-process host user)
+       cmd
+       msg
+       (list (lambda (result line host user cmd msg cont nowait)
+              (or cont (setq afsc-result result
+                             afsc-line line))
+              (if result (ange-ftp-call-cont cont result line)
+                (ange-ftp-raw-send-cmd
+                 (ange-ftp-get-process host user)
+                 cmd
+                 msg
+                 (list (lambda (result line cont)
+                         (or cont (setq afsc-result result
+                                        afsc-line line))
+                         (ange-ftp-call-cont cont result line))
+                       cont)
+                 nowait)))
+            host user cmd msg cont nowait)
+       nowait)
+
+      (if nowait
+         nil
+       (if cont
            nil
-         (if cont
-             nil
-           (cons afsc-result afsc-line)))))))
+         (cons afsc-result afsc-line))))))
 
 ;; It might be nice to message users about the host type identified,
 ;; but there is so much other messaging going on, it would not be


But I'm not familiar with ange-ftp knowing whether there are
undesired side-effects.

>         Stefan

Best regards, Michael.





reply via email to

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