fix(lib): doom/sudo-find-file: expand given path

It's possible for the user to type shell variables (something like
`$MYVAR/dir/filename`) as part of the filepath, so we need to call
`expand-file-name`.
This commit is contained in:
Mathew 2024-02-10 21:57:22 +00:00 committed by Yann Esposito (Yogsototh)
parent f6e4dce1be
commit e3deab3e21
Signed by untrusted user who does not match committer: yogsototh
GPG key ID: 7B19A4C650D59646

View file

@ -487,7 +487,7 @@ If FORCE-P, overwrite the destination file if it exists, without confirmation."
(defun doom/sudo-find-file (file)
"Open FILE as root."
(interactive "FOpen file as root: ")
(find-file (doom--sudo-file-path file)))
(find-file (doom--sudo-file-path (expand-file-name file))))
;;;###autoload
(defun doom/sudo-this-file ()