Ruiyang Wu <ywwr...@gmail.com> writes:

Hi Ruiyang,

> Oh there is one important thing I forget to mention. To see this
> behavior, you need to use "-lh" flags for “ls”. It shouldn’t include
> the “-a” flag. Once you set that, you should be able to reproduce
> easily.

Thanks for the traces and the recipe. With this, the fix was easy (see
appended patch). Will appear with Tramp 2.6.0.3 on GNU ELPA.

> Best,
> Ruiyang

Best regards, Michael.

diff --git a/lisp/tramp-sh.el b/lisp/tramp-sh.el
index 83ff936c..07d5c5a8 100644
--- a/lisp/tramp-sh.el
+++ b/lisp/tramp-sh.el
@@ -2711,8 +2711,8 @@ The method used must be an out-of-band method."
 		      ;; End is followed by \n or by " -> ".
 		      (put-text-property start end 'dired-filename t))))))
 	  ;; Remove trailing lines.
-	  (beginning-of-line)
-	  (while (looking-at "//")
+	  (goto-char (point-max))
+	  (while (re-search-backward (rx bol "//") nil 'noerror)
 	    (forward-line 1)
 	    (delete-region (match-beginning 0) (point))))
 	;; Reset multibyte if needed.

Reply via email to