1
0
Fork 0

get username from the password file instead of using `cuserid'.

* tekuti/util.scm (expanduser): Use the user id to fetch the
  username from the /etc/passwd file, so that the username is
  not chopped at eight characters.
This commit is contained in:
Ramakrishnan Muthukrishnan 2010-11-16 13:50:29 +05:30 committed by Andy Wingo
parent b8b1f47d65
commit 1692732222

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)
(cuserid) (vector-ref (getpwuid (getuid)) 0)
(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)))