emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master c2c9ef2 2/2: Fix error in tramp-sh.el


From: Michael Albinus
Subject: [Emacs-diffs] master c2c9ef2 2/2: Fix error in tramp-sh.el
Date: Sat, 13 Apr 2019 06:34:55 -0400 (EDT)

branch: master
commit c2c9ef2c1e509f1a01ffaefd7475004854162a10
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>

    Fix error in tramp-sh.el
    
    * lisp/net/tramp-sh.el (tramp-sh-handle-make-process):
    Revert "simplification", which was an error.
---
 lisp/net/tramp-sh.el | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 7d903c5..d9751a9 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -2903,7 +2903,8 @@ the result will be a local, non-Tramp, file name."
                    ;; otherwise we might be interrupted by
                    ;; `verify-visited-file-modtime'.
                    (let ((buffer-undo-list t)
-                         (inhibit-read-only t))
+                         (inhibit-read-only t)
+                         (mark (point-max)))
                      (clear-visited-file-modtime)
                      (narrow-to-region (point-max) (point-max))
                      ;; We call `tramp-maybe-open-connection', in
@@ -2916,7 +2917,12 @@ the result will be a local, non-Tramp, file name."
                        (let ((pid (tramp-send-command-and-read v "echo $$")))
                          (process-put p 'remote-pid pid)
                          (tramp-set-connection-property p "remote-pid" pid))
-                       (delete-region (point-min) (point-max))
+                       ;; `tramp-maybe-open-connection' and
+                       ;; `tramp-send-command-and-read' could have
+                       ;; trashed the connection buffer.  Remove this.
+                       (widen)
+                       (delete-region mark (point-max))
+                       (narrow-to-region (point-max) (point-max))
                        ;; Now do it.
                        (if command
                            ;; Send the command.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]