* net/ange-ftp.el (ange-ftp-copy-file-internal): Check for
authorMichael Albinus <michael.albinus@gmx.de>
Fri, 23 Dec 2011 14:31:35 +0000 (15:31 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Fri, 23 Dec 2011 14:31:35 +0000 (15:31 +0100)
existence of source file.  (Bug#10325)

lisp/ChangeLog
lisp/net/ange-ftp.el

index f1a3a45..4f7d61b 100644 (file)
@@ -1,3 +1,8 @@
+2011-12-23  Michael Albinus  <michael.albinus@gmx.de>
+
+       * net/ange-ftp.el (ange-ftp-copy-file-internal): Check for
+       existence of source file.  (Bug#10325)
+
 2011-12-23  Alan Mackenzie  <acm@muc.de>
 
        Fix unstable fontification inside templates.
index 06d200c..b7fdd9a 100644 (file)
@@ -3637,6 +3637,10 @@ so return the size on the remote host exactly. See RFC 3659."
   (setq filename (expand-file-name filename)
        newname (expand-file-name newname))
 
+  (or (file-exists-p filename)
+      (signal 'file-error
+             (list "Copy file" "no such file or directory" filename)))
+
   ;; canonicalize newname if a directory.
   (if (file-directory-p newname)
       (setq newname (expand-file-name (file-name-nondirectory filename) newname)))