Fix error when XDG_*_HOME is specified

Unlike some other lisps scheme's `unless' returns `#<unspecified>'
instead of nil, and `string-append' doesn't accept this as a valid
argument. So use an empty string if XDG_*_HOME has been specified and
FALLBACK otherwise.
This commit is contained in:
Tom Willemse 2013-05-10 21:58:31 +02:00
parent 87217e9858
commit addf53abed

View file

@ -90,7 +90,7 @@
(define (storage-dir xdg-env fallback)
(let ((xdg (getenv xdg-env)))
(string-append
(or xdg (getenv "HOME")) (unless xdg "/" fallback) "/gitto")))
(or xdg (getenv "HOME")) (if xdg "" fallback) "/gitto")))
(define (config-dir) (storage-dir "XDG_CONFIG_HOME" "/.config"))
(define (config-file file) (string-append (config-dir) "/" file))