changeset 64862:15e2ef5c7c16

* lisp/net/ange-ftp.el (ange-ftp-send-cmd): Make it work properly with uploading files. (ange-ftp-canonize-filename): Handle file names beginning with ~ correctly.
author Michael Albinus <michael.albinus@gmx.de>
date Tue, 09 Aug 2005 21:00:39 +0000
parents 7a8556a71193
children 2838cf662e70
files lisp/ChangeLog lisp/net/ange-ftp.el
diffstat 2 files changed, 22 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Tue Aug 09 20:38:35 2005 +0000
+++ b/lisp/ChangeLog	Tue Aug 09 21:00:39 2005 +0000
@@ -1,3 +1,10 @@
+2005-08-09  Katsumi Yamaoka  <yamaoka@jpl.org>  (tiny change)
+
+	* net/ange-ftp.el (ange-ftp-send-cmd): Make it work properly with
+	uploading files.
+	(ange-ftp-canonize-filename): Handle file names beginning with ~
+	correctly.
+
 2005-08-09  Juanma Barranquero  <lekktu@gmail.com>
 
 	* textmodes/fill.el (canonically-space-region)
@@ -23,7 +30,7 @@
 2005-08-09  Magnus Henoch  <mange@freemail.hu>
 
 	* textmodes/ispell.el (ispell-find-aspell-dictionaries): New command.
-	(ispell-have-aspell-dictionaries): New variable.  
+	(ispell-have-aspell-dictionaries): New variable.
 	(ispell-aspell-data-dir, ispell-aspell-dict-dir): New variables.
 	(ispell-get-aspell-config-value): New function.
 	(ispell-aspell-find-dictionary): New function.
@@ -31,7 +38,7 @@
 	(ispell-valid-dictionary-list): Call ispell-find-aspell-dictionaries if
 	appropriate.  Don't look for ispell dictionaries if we use aspell.
 	(ispell-menu-map): Don't build a submenu of dictionaries.
-	
+
 2005-08-09  Richard M. Stallman  <rms@gnu.org>
 
 	* progmodes/sql.el (sql-interactive-mode-map): Use fboundp.
--- a/lisp/net/ange-ftp.el	Tue Aug 09 20:38:35 2005 +0000
+++ b/lisp/net/ange-ftp.el	Tue Aug 09 21:00:39 2005 +0000
@@ -2328,8 +2328,13 @@
 	;; 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)))
+	  (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
@@ -3122,8 +3127,12 @@
 			(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)))
+		       (setq name (cond ((string-equal rest "")
+					 dir)
+					((string-equal dir "/")
+					 rest)
+					(t
+					 (concat dir rest))))
 		     (error "User \"%s\" is not known"
 			    (substring tilda 1)))))