aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2022-08-04 18:12:25 +0200
committerMichael Albinus2022-08-04 18:12:25 +0200
commite3edbf577b49bbff0527cd6f3242a98916947875 (patch)
tree96b3e06be4fb752962f80b42b6df7bf0ff0dc7b3
parentbccb3abef7d627cfa1c5170cb0d30d0450284ec3 (diff)
downloademacs-e3edbf577b49bbff0527cd6f3242a98916947875.tar.gz
emacs-e3edbf577b49bbff0527cd6f3242a98916947875.zip
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.
-rw-r--r--lisp/net/tramp-adb.el2
-rw-r--r--lisp/net/tramp-sh.el4
-rw-r--r--lisp/net/tramp.el12
3 files changed, 10 insertions, 8 deletions
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index 1d35f2b2ff7..ef0cc2d66c6 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -521,7 +521,7 @@ Emacs dired can't find files."
521 ;; file is created. Do it directly. 521 ;; file is created. Do it directly.
522 (if (and (stringp start) (string-empty-p start)) 522 (if (and (stringp start) (string-empty-p start))
523 (tramp-adb-send-command-and-check 523 (tramp-adb-send-command-and-check
524 v (format "echo -n \"\">%s" (tramp-shell-quote-argument localname))) 524 v (format "echo -n \"\" >%s" (tramp-shell-quote-argument localname)))
525 525
526 (let ((tmpfile (tramp-compat-make-temp-file filename))) 526 (let ((tmpfile (tramp-compat-make-temp-file filename)))
527 (when (and append (file-exists-p filename)) 527 (when (and append (file-exists-p filename))
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index d88e388cd56..9e5347252ad 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -3340,7 +3340,9 @@ implementation will be used."
3340 ;; file is created. Do it directly. 3340 ;; file is created. Do it directly.
3341 (if (and (stringp start) (string-empty-p start)) 3341 (if (and (stringp start) (string-empty-p start))
3342 (tramp-send-command 3342 (tramp-send-command
3343 v (format "echo -n \"\">%s" (tramp-shell-quote-argument localname))) 3343 v (format "cat <%s >%s"
3344 (tramp-get-remote-null-device v)
3345 (tramp-shell-quote-argument localname)))
3344 3346
3345 ;; Short track: if we are on the local host, we can run directly. 3347 ;; Short track: if we are on the local host, we can run directly.
3346 (if (and (tramp-local-host-p v) 3348 (if (and (tramp-local-host-p v)
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 0446e5754ae..a35b9baaa8c 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -1487,21 +1487,21 @@ If nil, return `tramp-default-port'."
1487(put #'tramp-file-name-port-or-default 'tramp-suppress-trace t) 1487(put #'tramp-file-name-port-or-default 'tramp-suppress-trace t)
1488 1488
1489;;;###tramp-autoload 1489;;;###tramp-autoload
1490(defun tramp-file-name-unify (vec &optional file) 1490(defun tramp-file-name-unify (vec &optional localname)
1491 "Unify VEC by removing localname and hop from `tramp-file-name' structure. 1491 "Unify VEC by removing localname and hop from `tramp-file-name' structure.
1492If FILE is a string, set it as localname. 1492If LOCALNAME is a string, set it as localname.
1493Objects returned by this function compare `equal' if they refer to the 1493Objects returned by this function compare `equal' if they refer to the
1494same connection. Make a copy in order to avoid side effects." 1494same connection. Make a copy in order to avoid side effects."
1495 (when (tramp-file-name-p vec) 1495 (when (tramp-file-name-p vec)
1496 (setq vec (copy-tramp-file-name vec)) 1496 (setq vec (copy-tramp-file-name vec))
1497 (setf (tramp-file-name-localname vec) 1497 (setf (tramp-file-name-localname vec)
1498 (and (stringp file) 1498 (and (stringp localname)
1499 ;; FIXME: This is a sanity check. When this error 1499 ;; FIXME: This is a sanity check. When this error
1500 ;; doesn't happen for a while, it can be removed. 1500 ;; doesn't happen for a while, it can be removed.
1501 (or (file-name-absolute-p file) 1501 (or (file-name-absolute-p localname)
1502 (tramp-error 1502 (tramp-error
1503 vec 'file-error "File `%s' must be absolute" file)) 1503 vec 'file-error "File `%s' must be absolute" localname))
1504 (directory-file-name (tramp-compat-file-name-unquote file))) 1504 (tramp-compat-file-name-unquote (directory-file-name localname)))
1505 (tramp-file-name-hop vec) nil)) 1505 (tramp-file-name-hop vec) nil))
1506 vec) 1506 vec)
1507 1507