diff options
Diffstat (limited to 'module/hnh/util')
-rw-r--r-- | module/hnh/util/env.scm | 6 | ||||
-rw-r--r-- | module/hnh/util/exceptions.scm | 3 | ||||
-rw-r--r-- | module/hnh/util/path.scm | 11 |
3 files changed, 11 insertions, 9 deletions
diff --git a/module/hnh/util/env.scm b/module/hnh/util/env.scm index 32ea1cc1..f5992245 100644 --- a/module/hnh/util/env.scm +++ b/module/hnh/util/env.scm @@ -16,7 +16,11 @@ (list n new-value (getenv n))) (list (symbol->string (quote name)) ...) (list value ...))) - (for-each (lambda (pair) (setenv (car pair) (cadr pair))) + (for-each (lambda (pair) + (if (cadr pair) + (setenv (car pair) + (cadr pair)) + (unsetenv (car pair)))) env-pairs)) (lambda () body ...) (lambda () diff --git a/module/hnh/util/exceptions.scm b/module/hnh/util/exceptions.scm index 344eb27a..1c3de8c7 100644 --- a/module/hnh/util/exceptions.scm +++ b/module/hnh/util/exceptions.scm @@ -33,8 +33,7 @@ (define (fatal fmt . args) (display (format #f "FATAL: ~?~%" fmt (or args '())) (current-error-port)) - (raise 2) - ) + (raise SIGINT)) (define (filter-stack pred? stk) 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)) |