Fix expanduser on absolute paths.
* tekuti/util.scm (expanduser): Fix when given absolute paths.
This commit is contained in:
parent
e45cd521f9
commit
7ecade64bd
1 changed files with 2 additions and 1 deletions
|
@ -103,7 +103,8 @@
|
|||
|
||||
(define (expanduser path)
|
||||
(let ((parts (string-split path #\/)))
|
||||
(if (eqv? (string-ref (car parts) 0) #\~)
|
||||
(if (and (not (string-null? (car parts)))
|
||||
(eqv? (string-ref (car parts) 0) #\~))
|
||||
(let ((user (if (= (string-length (car parts)) 1)
|
||||
(passwd:name (getpwuid (geteuid)))
|
||||
(substring (car parts) 1))))
|
||||
|
|
Loading…
Reference in a new issue