@@ -135,8 +135,10 @@ This setting has precedence over `auto-save-file-name-transforms'."
135
135
:type '(choice (const :tag "Use default" nil)
136
136
(directory :tag "Auto save directory name")))
137
137
138
+ ;; Suppress `shell-file-name' for w32 systems.
138
139
(defcustom tramp-encoding-shell
139
- (or (tramp-compat-funcall 'w32-shell-name) "/bin/sh")
140
+ (let (shell-file-name)
141
+ (or (tramp-compat-funcall 'w32-shell-name) "/bin/sh"))
140
142
"Use this program for encoding and decoding commands on the local host.
141
143
This shell is used to execute the encoding and decoding command on the
142
144
local host, so if you want to use `~' in those commands, you should
@@ -159,15 +161,19 @@ use for the remote host."
159
161
:group 'tramp
160
162
:type '(file :must-match t))
161
163
164
+ ;; Suppress `shell-file-name' for w32 systems.
162
165
(defcustom tramp-encoding-command-switch
163
- (if (tramp-compat-funcall 'w32-shell-dos-semantics) "/c" "-c")
166
+ (let (shell-file-name)
167
+ (if (tramp-compat-funcall 'w32-shell-dos-semantics) "/c" "-c"))
164
168
"Use this switch together with `tramp-encoding-shell' for local commands.
165
169
See the variable `tramp-encoding-shell' for more information."
166
170
:group 'tramp
167
171
:type 'string)
168
172
173
+ ;; Suppress `shell-file-name' for w32 systems.
169
174
(defcustom tramp-encoding-command-interactive
170
- (unless (tramp-compat-funcall 'w32-shell-dos-semantics) "-i")
175
+ (let (shell-file-name)
176
+ (unless (tramp-compat-funcall 'w32-shell-dos-semantics) "-i"))
171
177
"Use this switch together with `tramp-encoding-shell' for interactive shells.
172
178
See the variable `tramp-encoding-shell' for more information."
173
179
:version "24.1"
@@ -4391,13 +4397,13 @@ If FILENAME is remote, a file name handler is called."
4391
4397
(let ((handler (find-file-name-handler filename 'tramp-set-file-uid-gid)))
4392
4398
(if handler
4393
4399
(funcall handler #'tramp-set-file-uid-gid filename uid gid)
4394
- ;; On W32 "chown" does not work.
4400
+ ;; On W32 systems, "chown" does not work.
4395
4401
(unless (memq system-type '(ms-dos windows-nt))
4396
4402
(let ((uid (or (and (natnump uid) uid) (tramp-get-local-uid 'integer)))
4397
4403
(gid (or (and (natnump gid) gid) (tramp-get-local-gid 'integer))))
4398
4404
(tramp-call-process
4399
- nil "chown" nil nil nil
4400
- (format "%d:%d" uid gid) ( shell-quote-argument filename)))))))
4405
+ nil "chown" nil nil nil (format "%d:%d" uid gid)
4406
+ (tramp-unquote- shell-quote-argument filename)))))))
4401
4407
4402
4408
(defun tramp-get-local-uid (id-format)
4403
4409
"The uid of the local user, in ID-FORMAT.
@@ -4815,8 +4821,11 @@ T1 and T2 are time values (as returned by `current-time' for example)."
4815
4821
(float-time (time-subtract t1 t2)))
4816
4822
4817
4823
(defun tramp-unquote-shell-quote-argument (s)
4818
- "Remove quotation prefix \"/:\" from string S, and quote it then for shell."
4819
- (shell-quote-argument (tramp-compat-file-name-unquote s)))
4824
+ "Remove quotation prefix \"/:\" from string S, and quote it then for shell.
4825
+ Suppress `shell-file-name'. This is needed on w32 systems, which
4826
+ would use a wrong quoting for local file names. See `w32-shell-name'."
4827
+ (let (shell-file-name)
4828
+ (shell-quote-argument (tramp-compat-file-name-unquote s))))
4820
4829
4821
4830
;; Currently (as of Emacs 20.5), the function `shell-quote-argument'
4822
4831
;; does not deal well with newline characters. Newline is replaced by
0 commit comments