Function: treemacs--unslash

treemacs--unslash is a byte-compiled function defined in treemacs-core-utils.el.

Signature

(treemacs--unslash PATH)

Documentation

Remove the final slash in PATH.

Source Code

;; Defined in ~/.emacs.d/elpa/treemacs-20251226.1307/treemacs-core-utils.el
(define-inline treemacs--unslash (path)
  "Remove the final slash in PATH."
  (declare (pure t) (side-effect-free t))
  (inline-letevals (path)
    (inline-quote
     (if (and (> (length ,path) 1)
              (eq ?/ (aref ,path (1- (length ,path)))))
         (substring ,path 0 -1)
       ,path))))