(zilch lang ninja build): fix relative-to normalisation for empty paths

This commit is contained in:
puck 2025-05-09 13:09:49 +00:00
parent 5b4bb8cd8a
commit ca920c0ae3

View file

@ -120,7 +120,7 @@
;; to be a nixpkgs-style derivation, the same way `nix-shell` works.
(define (process-ninja-file file vfs environment relative-to)
(when (or (derivation? environment) (store-path? environment)) (set! environment (environment-for-derivation environment)))
(unless (string-suffix? "/" relative-to) (set! relative-to (string-append relative-to "/")))
(unless (or (string=? relative-to "") (string-suffix? "/" relative-to)) (set! relative-to (string-append relative-to "/")))
(define edges (mapping (make-default-comparator)))