changeset 10748:0bee4d7bc9a4

(ange-ftp-write-region, ange-ftp-insert-file-contents) (ange-ftp-copy-file-internal): If remote host is unix, use binary mode. (ange-ftp-file-local-copy): Delete local var bin1. (ange-ftp-rename-remote-to-remote): Delete arg `binary'. (ange-ftp-rename-file): Don't pass or compute that arg.
author Richard M. Stallman <rms@gnu.org>
date Tue, 14 Feb 1995 14:28:44 +0000
parents c6a68e4ee53a
children 2834ab2db11a
files lisp/ange-ftp.el
diffstat 1 files changed, 11 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ange-ftp.el	Tue Feb 14 14:27:18 1995 +0000
+++ b/lisp/ange-ftp.el	Tue Feb 14 14:28:44 1995 +0000
@@ -2900,7 +2900,8 @@
 	       (user (nth 1 parsed))
 	       (name (ange-ftp-quote-string (nth 2 parsed)))
 	       (temp (ange-ftp-make-tmp-name host))
-	       (binary (ange-ftp-binary-file filename))
+	       (binary (or (ange-ftp-binary-file filename)
+			   (eq (ange-ftp-host-type host user) 'unix)))
 	       (cmd (if append 'append 'put))
 	       (abbr (ange-ftp-abbreviate-filename filename)))
 	  (unwind-protect
@@ -2962,7 +2963,8 @@
 		     (user (nth 1 parsed))
 		     (name (ange-ftp-quote-string (nth 2 parsed)))
 		     (temp (ange-ftp-make-tmp-name host))
-		     (binary (ange-ftp-binary-file filename))
+		     (binary (or (ange-ftp-binary-file filename)
+				 (eq (ange-ftp-host-type host user) 'unix)))
 		     (abbr (ange-ftp-abbreviate-filename filename))
 		     size)
 		(unwind-protect
@@ -3242,7 +3244,9 @@
 	     (t-name (and t-parsed (ange-ftp-quote-string (nth 2 t-parsed))))
 	     (t-abbr (ange-ftp-abbreviate-filename newname filename))
 	     (binary (or (ange-ftp-binary-file filename)
-			 (ange-ftp-binary-file newname)))
+			 (ange-ftp-binary-file newname)
+			 (and (eq (ange-ftp-host-type f-host f-user) 'unix)
+			      (eq (ange-ftp-host-type t-host t-user) 'unix))))
 	     temp1
 	     temp2)
 
@@ -3401,8 +3405,7 @@
 ;;;; File renaming support.
 ;;;; ------------------------------------------------------------
 
-(defun ange-ftp-rename-remote-to-remote (filename newname f-parsed t-parsed
-						  binary)
+(defun ange-ftp-rename-remote-to-remote (filename newname f-parsed t-parsed)
   "Rename remote file FILE to remote file NEWNAME."
   (let ((f-host (nth 0 f-parsed))
 	(f-user (nth 1 f-parsed))
@@ -3454,8 +3457,7 @@
   (setq filename (expand-file-name filename))
   (setq newname (expand-file-name newname))
   (let* ((f-parsed (ange-ftp-ftp-name filename))
-	 (t-parsed (ange-ftp-ftp-name newname))
-	 (binary (if (or f-parsed t-parsed) (ange-ftp-binary-file filename))))
+	 (t-parsed (ange-ftp-ftp-name newname)))
     (if (and (or f-parsed t-parsed)
 	     (or (not ok-if-already-exists)
 		 (numberp ok-if-already-exists)))
@@ -3466,7 +3468,7 @@
     (if f-parsed
 	(if t-parsed
 	    (ange-ftp-rename-remote-to-remote filename newname f-parsed
-					      t-parsed binary)
+					      t-parsed)
 	  (ange-ftp-rename-remote-to-local filename newname))
       (if t-parsed
 	  (ange-ftp-rename-local-to-remote filename newname)
@@ -3672,8 +3674,7 @@
   (let* ((fn1 (expand-file-name file))
 	 (pa1 (ange-ftp-ftp-name fn1)))
     (if pa1
-	(let* ((tmp1 (ange-ftp-make-tmp-name (car pa1)))
-	       (bin1 (ange-ftp-binary-file fn1)))
+	(let ((tmp1 (ange-ftp-make-tmp-name (car pa1))))
 	  (ange-ftp-copy-file-internal fn1 tmp1 t nil
 				       (format "Getting %s" fn1))
 	  tmp1))))