From bfed5ed044a751254448ed78009e8a8cdffe3270 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 16 Sep 2012 15:31:30 +0200 Subject: Don't let expanduser fail on absolute path --- tekuti/util.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tekuti/util.scm b/tekuti/util.scm index e77d255..fe77c90 100644 --- a/tekuti/util.scm +++ b/tekuti/util.scm @@ -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)))) -- cgit v1.2.3-54-g00ecf