* lisp/speedbar.el (speedbar-directory-buttons): Make speedbar
work with directories accessed via Tramp (bug#44622).
Copyright-paperwork-exempt: yes
INDEX is not used, but is required by the caller."
(let* ((tilde (expand-file-name "~/"))
(dd (expand-file-name directory))
- (junk (string-match (regexp-quote tilde) dd))
+ (junk (string-prefix-p "~/" dd))
(displayme (if junk
- (concat "~/" (substring dd (match-end 0)))
+ (concat "~/" (substring dd 2 nil))
dd))
(p (point)))
(if (string-match "^~[/\\]?\\'" displayme) (setq displayme tilde))