summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2022-06-09 14:44:00 +0200
committerMichael Albinus <michael.albinus@gmx.de>2022-06-09 14:44:00 +0200
commit3fd08543782d0d417eaa2dda0727ea16b3271710 (patch)
tree3bb6782c63652b57cbd865c040ae2811335d8481 /lisp
parentd02c94090c4dd7c90da9ccd3268a9e02cadf0a45 (diff)
downloademacs-3fd08543782d0d417eaa2dda0727ea16b3271710.tar.gz
emacs-3fd08543782d0d417eaa2dda0727ea16b3271710.tar.bz2
emacs-3fd08543782d0d417eaa2dda0727ea16b3271710.zip
Fix file name quoting in tramp-smb.el (do not merge)
* lisp/net/tramp-smb.el (tramp-smb-handle-write-region): Quote tmpfile. (tramp-smb-get-localname): Remove superfluous test. (Bug#55855) * test/lisp/net/tramp-tests.el (tramp-test03-file-name-method-rules): Remove superfluous checks.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/net/tramp-smb.el7
1 files changed, 3 insertions, 4 deletions
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index 2aaa6e8ab3f..dfcb7162c80 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -1631,7 +1631,7 @@ errors for shares like \"C$/\", which are common in Microsoft Windows."
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)))
@@ -1695,9 +1695,8 @@ If VEC has no cifs capabilities, exchange \"/\" by \"\\\\\"."
(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)))