diff options
Diffstat (limited to 'module/hnh/util/path.scm')
-rw-r--r-- | module/hnh/util/path.scm | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/module/hnh/util/path.scm b/module/hnh/util/path.scm index b0991073..b92de8cd 100644 --- a/module/hnh/util/path.scm +++ b/module/hnh/util/path.scm @@ -17,7 +17,8 @@ (define path-absolute? absolute-file-name?) ;; TODO remove intermidiate period components -(define (path-append . strings) +;; e.x. /a/../b => /b +(define (path-append path . paths) (fold (lambda (s done) (string-append done @@ -33,11 +34,9 @@ ;; the path absolute. This isn't exactly correct if we have ;; drive letters, but on those system the user should make ;; sure that the first component of the path is non-empty. - (let ((s (car strings))) - (if (string-null? s) - // s)) - (cdr strings) - )) + (if (string-null? path) + // path) + paths)) (define (path-join lst) (apply path-append lst)) |