From 23de8e1f5a80fdf05469b4961ba0eaafb4531b0e Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 9 Sep 2024 16:54:08 -0400 Subject: Fix up some stuff with path escaping --- builtins/path.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'builtins/path.h') diff --git a/builtins/path.h b/builtins/path.h index 4ee1b0a7..6772f72d 100644 --- a/builtins/path.h +++ b/builtins/path.h @@ -11,12 +11,13 @@ #define Path_t Text_t #define Path(text) ((Path_t)Text(text)) -#define Paths(...) Path$concat(__VA_ARGS__) +#define Paths(...) Path$_concat(sizeof((Path_t[]){__VA_ARGS__})/sizeof(Path_t), (Path_t[]){__VA_ARGS__}) Path_t Path$cleanup(Path_t path); Path_t Path$_concat(int n, Path_t items[n]); -#define Path$concat(...) Path$_concat(sizeof((Path_t[]){__VA_ARGS__})/sizeof(Path_t), (Path_t[]){__VA_ARGS__}) +#define Path$concat(a, b) Paths(a, Path("/"), b) PUREFUNC Path_t Path$escape_text(Text_t text); +PUREFUNC Path_t Path$escape_path(Text_t path); Path_t Path$resolved(Path_t path, Path_t relative_to); Path_t Path$relative(Path_t path, Path_t relative_to); bool Path$exists(Path_t path); -- cgit v1.2.3