1
0
Fork 0

Fix expanduser on absolute paths.

* tekuti/util.scm (expanduser): Fix when given absolute paths.
This commit is contained in:
Andy Wingo 2014-10-22 16:14:59 +02:00
parent e45cd521f9
commit 7ecade64bd

View file

@ -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))))