;; Default settings for connection-local variables.
(defconst tramp-adb-connection-local-default-profile
- ;; `w32-shell-name' is derived from `shell-file-name'. Don't let it
- ;; be confused.
- (unless (eq system-type 'windows-nt)
- '((shell-file-name . "/system/bin/sh")
- (shell-command-switch . "-c")))
+ '((shell-file-name . "/system/bin/sh")
+ (shell-command-switch . "-c"))
"Default connection-local variables for remote adb connections.")
;; `connection-local-set-profile-variables' and
;;; Default connection-local variables for Tramp:
(defconst tramp-connection-local-default-profile
- ;; `w32-shell-name' is derived from `shell-file-name'. Don't let it
- ;; be confused.
- (unless (eq system-type 'windows-nt)
- '((shell-file-name . "/bin/sh")
- (shell-command-switch . "-c")))
+ '((shell-file-name . "/bin/sh")
+ (shell-command-switch . "-c"))
"Default connection-local variables for remote connections.")
;; `connection-local-set-profile-variables' and
;; the pipe symbol be quoted if they use forward
;; slashes as directory separators.
(mapconcat
- #'shell-quote-argument (split-string compress) " ")
+ #'tramp-unquote-shell-quote-argument
+ (split-string compress) " ")
(mapconcat
- #'shell-quote-argument (split-string decompress) " "))
+ #'tramp-unquote-shell-quote-argument
+ (split-string decompress) " "))
nil nil))
(throw 'next nil))
(tramp-message
((tramp-get-method-parameter vec 'tramp-remote-copy-program)
localname)
((not (zerop (length user)))
- (format "%s@%s:%s" user host (shell-quote-argument localname)))
- (t (format "%s:%s" host (shell-quote-argument localname))))))
+ (format
+ "%s@%s:%s" user host (tramp-unquote-shell-quote-argument localname)))
+ (t (format "%s:%s" host (tramp-unquote-shell-quote-argument localname))))))
(defun tramp-method-out-of-band-p (vec size)
"Return t if this is an out-of-band method, nil otherwise."
:type '(choice (const :tag "Use default" nil)
(directory :tag "Auto save directory name")))
+;; Suppress `shell-file-name' for w32 systems.
(defcustom tramp-encoding-shell
- (or (tramp-compat-funcall 'w32-shell-name) "/bin/sh")
+ (let (shell-file-name)
+ (or (tramp-compat-funcall 'w32-shell-name) "/bin/sh"))
"Use this program for encoding and decoding commands on the local host.
This shell is used to execute the encoding and decoding command on the
local host, so if you want to use `~' in those commands, you should
:group 'tramp
:type '(file :must-match t))
+;; Suppress `shell-file-name' for w32 systems.
(defcustom tramp-encoding-command-switch
- (if (tramp-compat-funcall 'w32-shell-dos-semantics) "/c" "-c")
+ (let (shell-file-name)
+ (if (tramp-compat-funcall 'w32-shell-dos-semantics) "/c" "-c"))
"Use this switch together with `tramp-encoding-shell' for local commands.
See the variable `tramp-encoding-shell' for more information."
:group 'tramp
:type 'string)
+;; Suppress `shell-file-name' for w32 systems.
(defcustom tramp-encoding-command-interactive
- (unless (tramp-compat-funcall 'w32-shell-dos-semantics) "-i")
+ (let (shell-file-name)
+ (unless (tramp-compat-funcall 'w32-shell-dos-semantics) "-i"))
"Use this switch together with `tramp-encoding-shell' for interactive shells.
See the variable `tramp-encoding-shell' for more information."
:version "24.1"
(let ((handler (find-file-name-handler filename 'tramp-set-file-uid-gid)))
(if handler
(funcall handler #'tramp-set-file-uid-gid filename uid gid)
- ;; On W32 "chown" does not work.
+ ;; On W32 systems, "chown" does not work.
(unless (memq system-type '(ms-dos windows-nt))
(let ((uid (or (and (natnump uid) uid) (tramp-get-local-uid 'integer)))
(gid (or (and (natnump gid) gid) (tramp-get-local-gid 'integer))))
(tramp-call-process
- nil "chown" nil nil nil
- (format "%d:%d" uid gid) (shell-quote-argument filename)))))))
+ nil "chown" nil nil nil (format "%d:%d" uid gid)
+ (tramp-unquote-shell-quote-argument filename)))))))
(defun tramp-get-local-uid (id-format)
"The uid of the local user, in ID-FORMAT.
(float-time (time-subtract t1 t2)))
(defun tramp-unquote-shell-quote-argument (s)
- "Remove quotation prefix \"/:\" from string S, and quote it then for shell."
- (shell-quote-argument (tramp-compat-file-name-unquote s)))
+ "Remove quotation prefix \"/:\" from string S, and quote it then for shell.
+Suppress `shell-file-name'. This is needed on w32 systems, which
+would use a wrong quoting for local file names. See `w32-shell-name'."
+ (let (shell-file-name)
+ (shell-quote-argument (tramp-compat-file-name-unquote s))))
;; Currently (as of Emacs 20.5), the function `shell-quote-argument'
;; does not deal well with newline characters. Newline is replaced by