1
0
Fork 0

expanduser tweaks

* tekuti/util.scm (expanduser): Use passwd:name accessor, and geteuid as
  cuserid did.
This commit is contained in:
Andy Wingo 2010-11-18 11:16:50 +01:00
parent 1692732222
commit 3ece90674a

View file

@ -89,7 +89,7 @@
(let ((parts (string-split path #\/))) (let ((parts (string-split path #\/)))
(if (eqv? (string-ref (car parts) 0) #\~) (if (eqv? (string-ref (car parts) 0) #\~)
(let ((user (if (= (string-length (car parts)) 1) (let ((user (if (= (string-length (car parts)) 1)
(vector-ref (getpwuid (getuid)) 0) (passwd:name (getpwuid (geteuid)))
(substring (car parts) 1)))) (substring (car parts) 1))))
(string-join (cons (passwd:dir (getpwnam user)) (cdr parts)) "/")) (string-join (cons (passwd:dir (getpwnam user)) (cdr parts)) "/"))
path))) path)))