mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 17:24:23 +00:00
Fix last Tramp change, especially for bug#56963
* lisp/net/tramp-adb.el (tramp-adb-handle-write-region): Add missing space. * lisp/net/tramp-sh.el (tramp-sh-handle-write-region): Use "cat", "echo -n" isn't portable. (Bug#56963) * lisp/net/tramp.el (tramp-file-name-unify): Unquote file name in time.
This commit is contained in:
parent
bccb3abef7
commit
e3edbf577b
3 changed files with 10 additions and 8 deletions
|
|
@ -521,7 +521,7 @@ Emacs dired can't find files."
|
|||
;; file is created. Do it directly.
|
||||
(if (and (stringp start) (string-empty-p start))
|
||||
(tramp-adb-send-command-and-check
|
||||
v (format "echo -n \"\">%s" (tramp-shell-quote-argument localname)))
|
||||
v (format "echo -n \"\" >%s" (tramp-shell-quote-argument localname)))
|
||||
|
||||
(let ((tmpfile (tramp-compat-make-temp-file filename)))
|
||||
(when (and append (file-exists-p filename))
|
||||
|
|
|
|||
|
|
@ -3340,7 +3340,9 @@ implementation will be used."
|
|||
;; file is created. Do it directly.
|
||||
(if (and (stringp start) (string-empty-p start))
|
||||
(tramp-send-command
|
||||
v (format "echo -n \"\">%s" (tramp-shell-quote-argument localname)))
|
||||
v (format "cat <%s >%s"
|
||||
(tramp-get-remote-null-device v)
|
||||
(tramp-shell-quote-argument localname)))
|
||||
|
||||
;; Short track: if we are on the local host, we can run directly.
|
||||
(if (and (tramp-local-host-p v)
|
||||
|
|
|
|||
|
|
@ -1487,21 +1487,21 @@ If nil, return `tramp-default-port'."
|
|||
(put #'tramp-file-name-port-or-default 'tramp-suppress-trace t)
|
||||
|
||||
;;;###tramp-autoload
|
||||
(defun tramp-file-name-unify (vec &optional file)
|
||||
(defun tramp-file-name-unify (vec &optional localname)
|
||||
"Unify VEC by removing localname and hop from `tramp-file-name' structure.
|
||||
If FILE is a string, set it as localname.
|
||||
If LOCALNAME is a string, set it as localname.
|
||||
Objects returned by this function compare `equal' if they refer to the
|
||||
same connection. Make a copy in order to avoid side effects."
|
||||
(when (tramp-file-name-p vec)
|
||||
(setq vec (copy-tramp-file-name vec))
|
||||
(setf (tramp-file-name-localname vec)
|
||||
(and (stringp file)
|
||||
(and (stringp localname)
|
||||
;; FIXME: This is a sanity check. When this error
|
||||
;; doesn't happen for a while, it can be removed.
|
||||
(or (file-name-absolute-p file)
|
||||
(or (file-name-absolute-p localname)
|
||||
(tramp-error
|
||||
vec 'file-error "File `%s' must be absolute" file))
|
||||
(directory-file-name (tramp-compat-file-name-unquote file)))
|
||||
vec 'file-error "File `%s' must be absolute" localname))
|
||||
(tramp-compat-file-name-unquote (directory-file-name localname)))
|
||||
(tramp-file-name-hop vec) nil))
|
||||
vec)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue