]> git.eshelyaron.com Git - emacs.git/commitdiff
Run tramp cleanup in correct buffer
authorDaniel Colascione <dancol@dancol.org>
Tue, 3 Sep 2019 20:16:21 +0000 (13:16 -0700)
committerDaniel Colascione <dancol@dancol.org>
Tue, 3 Sep 2019 20:19:24 +0000 (13:19 -0700)
Fixes bug #37297.

* lisp/net/tramp.el (tramp-process-sentinel): Do process-end cleanup
in the tramp buffer, not a random file buffer.

lisp/net/tramp.el

index d419f9d87d052ad6686f631b046fc9703ca13a11..fdad43ef6fa46221d889f6ca178335c3e89d6824 100644 (file)
@@ -4210,10 +4210,11 @@ the remote host use line-endings as defined in the variable
       (when vec
        (tramp-message vec 5 "Sentinel called: `%S' `%s'" proc event)
         (tramp-flush-connection-properties proc)
-        (tramp-flush-directory-properties vec ""))
-      (goto-char (point-max))
-      (when (and prompt (re-search-backward (regexp-quote prompt) nil t))
-       (delete-region (point) (point-max))))))
+        (tramp-flush-directory-properties vec "")
+        (with-current-buffer (tramp-get-buffer vec)
+          (goto-char (point-max))
+          (when (and prompt (re-search-backward (regexp-quote prompt) nil t))
+           (delete-region (point) (point-max))))))))
 
 (defun tramp-get-inode (vec)
   "Returns the virtual inode number.