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