1
0
Fork 0

- removed wrong assumption that input is a simple string when completing expanding the tilde as home of the user.

This commit is contained in:
cage 2023-03-02 17:51:13 +01:00
parent 283824f74a
commit 081fb45e06
1 changed files with 2 additions and 2 deletions

View File

@ -58,11 +58,11 @@ See: complete:directory-complete")
"Returns the supplied string, with a prefix of ~ or ~user expanded
to the appropriate home directory."
(if (and (> (length string) 0)
(eql (schar string 0) #\~))
(eql (elt string 0) #\~))
(flet ((chop (s)
(subseq s 0 (1- (length s)))))
(let* ((slash-index (loop for i below (length string)
when (eql (schar string i) #\/)
when (eql (elt string i) #\/)
return i))
(suffix (and slash-index (subseq string slash-index)))
(uname (subseq string 1 slash-index))