summaryrefslogtreecommitdiff
path: root/haunt/utils.scm
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2015-07-26 23:06:28 -0400
committerDavid Thompson <dthompson2@worcester.edu>2015-07-26 23:15:09 -0400
commit19a26608f2739f3744b8dc7254e8cfe5d24d3867 (patch)
treef451ffb1820501f0b5ff2ce7801a12a39c5e801f /haunt/utils.scm
parent2f6b06dd22f6f117d0a52e03d90f41a810889519 (diff)
utils: file-name-components: Handle empty string.
* haunt/utils.scm (file-name-components): Return the empty list when given the empty string.
Diffstat (limited to 'haunt/utils.scm')
-rw-r--r--haunt/utils.scm4
1 files changed, 3 insertions, 1 deletions
diff --git a/haunt/utils.scm b/haunt/utils.scm
index b69dab8..5fd97c7 100644
--- a/haunt/utils.scm
+++ b/haunt/utils.scm
@@ -67,7 +67,9 @@ flattened."
(define (file-name-components file-name)
"Split FILE-NAME into the components delimited by '/'."
- (string-split file-name #\/))
+ (if (string-null? file-name)
+ '()
+ (string-split file-name #\/)))
(define (join-file-name-components components)
"Join COMPONENTS into a file name string."