~ chicken-core (chicken-5) 0e98bc4286d608703d848cfdc617b58d511fc369


commit 0e98bc4286d608703d848cfdc617b58d511fc369
Author:     Evan Hanson <evhan@foldling.org>
AuthorDate: Sun Apr 28 16:55:07 2019 +1200
Commit:     Evan Hanson <evhan@foldling.org>
CommitDate: Sun Apr 28 16:55:07 2019 +1200

    Fix chicken-install error caused by non-string argument to `file-exists?'
    
    Commit d902e1cf introduced a potential error when chicken-install tries
    to load its defaults file, since `file-exists?' might be called with a
    non-string argument when `user-file' is false.
    
    The fix is simple, we just move the file existence test after the
    variable test, since `file-exists?' returns the filename anyway.

diff --git a/chicken-install.scm b/chicken-install.scm
index f35e4d28..91af7ddf 100644
--- a/chicken-install.scm
+++ b/chicken-install.scm
@@ -292,7 +292,7 @@
          (user-file (and cfg-dir (make-pathname (list cfg-dir "chicken")
                                                 +defaults-file+)))
          (deff (or user-defaults
-                   (and (file-exists? user-file) user-file)
+                   (and user-file (file-exists? user-file))
                    (make-pathname host-sharedir +defaults-file+))))
       (define (broken x)
 	(error "invalid entry in defaults file" deff x))
Trap