utils: file-name-components: Handle empty string.
* haunt/utils.scm (file-name-components): Return the empty list when given the empty string.
This commit is contained in:
		@@ -67,7 +67,9 @@ flattened."
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
(define (file-name-components file-name)
 | 
					(define (file-name-components file-name)
 | 
				
			||||||
  "Split FILE-NAME into the components delimited by '/'."
 | 
					  "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)
 | 
					(define (join-file-name-components components)
 | 
				
			||||||
  "Join COMPONENTS into a file name string."
 | 
					  "Join COMPONENTS into a file name string."
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user