* lisp/net/tramp-sh.el (tramp-sh-handle-insert-directory): Remove also
//DIRED-OPTIONS// line when there is no //DIRED// line.
;; 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.