diff options
author | Richard M. Stallman <rms@gnu.org> | 1998-05-15 20:35:58 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1998-05-15 20:35:58 +0000 |
commit | 85348a1744b43cd3a800ac1bed2f2e4b0d30b6f7 (patch) | |
tree | 34abfe7db1e74f6cdac210cdba0f95cce1f66d4a | |
parent | 81fee7cf1da9956f7796a915f98cc14630eb5ba7 (diff) | |
download | emacs-85348a1744b43cd3a800ac1bed2f2e4b0d30b6f7.tar.gz emacs-85348a1744b43cd3a800ac1bed2f2e4b0d30b6f7.tar.bz2 emacs-85348a1744b43cd3a800ac1bed2f2e4b0d30b6f7.zip |
(ange-ftp-start-process): Handle Windows ftp client.
-rw-r--r-- | lisp/ange-ftp.el | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/lisp/ange-ftp.el b/lisp/ange-ftp.el index 7230044e499..bd190091ec3 100644 --- a/lisp/ange-ftp.el +++ b/lisp/ange-ftp.el @@ -1974,7 +1974,23 @@ on the gateway machine to do the ftp instead." (process-kill-without-query proc) (set-process-sentinel proc (function ange-ftp-process-sentinel)) (set-process-filter proc (function ange-ftp-process-filter)) - (accept-process-output proc) ;wait for ftp startup message + ;; wait for ftp startup message + (if (not (eq system-type 'windows-nt)) + (accept-process-output proc) + ;; On Windows, the standard ftp client behaves a little oddly, + ;; initially buffering its output (because stdin/out are pipe + ;; handles). As a result, the startup message doesn't appear + ;; until enough output is generated to flush stdout, so a plain + ;; accept-process-output call at this point would hang + ;; indefinitely. So if nothing appears within 2 seconds, we try + ;; sending an innocuous command ("help foo") that forces some + ;; output. Curiously, once we start sending normal commands, the + ;; output no longer appears to be buffered, and everything works + ;; correctly (or at least appears to!). + (if (accept-process-output proc 2) + nil + (process-send-string proc "help foo\n") + (accept-process-output proc))) proc)) (put 'internal-ange-ftp-mode 'mode-class 'special) |