summary refs log tree commit diff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-09-18 17:00:17 +0200
committerLudovic Courtès <ludo@gnu.org>2017-09-19 12:19:15 +0200
commit82781d871f8753737448c562b3906b2a7f89581c (patch)
treec053434474f4a88119c9c39b6385129b4553c10a
parentd209ce434f4c2121eeecfa8939a928ade43d7764 (diff)
downloadguix-82781d871f8753737448c562b3906b2a7f89581c.tar.gz
utils: 'current-source-directory' gracefully deals with lack of location info.
* guix/utils.scm (current-source-directory): Adjust for when
'syntax-source' returns #f.
-rw-r--r--guix/utils.scm4
1 files changed, 2 insertions, 2 deletions
diff --git a/guix/utils.scm b/guix/utils.scm
index ab43ed4008..8fbbdc3563 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -700,7 +700,7 @@ failure."
 be determined."
     (syntax-case s ()
       ((_)
-       (match (assq 'filename (syntax-source s))
+       (match (assq 'filename (or (syntax-source s) '()))
          (('filename . (? string? file-name))
           ;; If %FILE-PORT-NAME-CANONICALIZATION is 'relative, then FILE-NAME
           ;; can be relative.  In that case, we try to find out at run time
@@ -713,7 +713,7 @@ be determined."
                  (dirname file-name))
                 (else
                  #`(absolute-dirname #,file-name))))
-         (_
+         (#f
           #f))))))
 
 ;; A source location.