v 3 (format "Moving tmp file %s to %s" tmpfile filename)
(unwind-protect
(unless (tramp-smb-send-command
- v (format "put %s \"%s\""
+ v (format "put \"%s\" \"%s\""
tmpfile (tramp-smb-get-localname v)))
(tramp-error v 'file-error "Cannot write `%s'" filename))
(delete-file tmpfile)))
(when (string-match "\\(\\$\\$\\)\\(/\\|$\\)" localname)
(setq localname (replace-match "$" nil nil localname 1)))
- ;; A period followed by a space, or trailing periods and spaces,
- ;; are not supported.
- (when (string-match-p "\\. \\|\\.$\\| $" localname)
+ ;; A trailing space is not supported.
+ (when (string-match-p " $" localname)
(tramp-error
vec 'file-error
"Invalid file name %s" (tramp-make-tramp-file-name vec localname)))
:type 'user-error)
(should-error
(expand-file-name "/method:user1@host1|ssh:user2@host2:/path/to/file")
- :type 'user-error))
-
- ;; Samba does not support file names with periods followed by
- ;; spaces, and trailing periods or spaces.
- (when (tramp--test-smb-p)
- (dolist (file '("foo." "foo. bar" "foo "))
- (should-error
- (tramp-smb-get-localname
- (tramp-dissect-file-name
- (expand-file-name file tramp-test-temporary-file-directory)))
- :type 'file-error))))
+ :type 'user-error)))
(ert-deftest tramp-test04-substitute-in-file-name ()
"Check `substitute-in-file-name'."