Don't let expanduser fail on absolute path
This commit is contained in:
parent
8d15d4e7f9
commit
bfed5ed044
1 changed files with 4 additions and 2 deletions
|
@ -102,8 +102,10 @@
|
|||
(display #\'))))
|
||||
|
||||
(define (expanduser path)
|
||||
(let ((parts (string-split path #\/)))
|
||||
(if (eqv? (string-ref (car parts) 0) #\~)
|
||||
(let* ((parts (string-split path #\/))
|
||||
(part (car parts)))
|
||||
(if (and (not (string-null? part))
|
||||
(eqv? (string-ref part 0) #\~))
|
||||
(let ((user (if (= (string-length (car parts)) 1)
|
||||
(passwd:name (getpwuid (geteuid)))
|
||||
(substring (car parts) 1))))
|
||||
|
|
Loading…
Reference in a new issue