From b4a0fda409f49c44c3aaee40575b438f0dfbbbe4 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 16 Mar 2025 16:52:00 -0400 Subject: Fix shell escaping of paths --- stdlib/shell.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'stdlib/shell.c') diff --git a/stdlib/shell.c b/stdlib/shell.c index 7c54950c..7dcc9a0a 100644 --- a/stdlib/shell.c +++ b/stdlib/shell.c @@ -6,6 +6,7 @@ #include "arrays.h" #include "integers.h" +#include "paths.h" #include "patterns.h" #include "shell.h" #include "text.h" @@ -17,6 +18,11 @@ public Shell_t Shell$escape_text(Text_t text) return Texts(Text("'"), Text$replace(text, Text("'"), Text("'\"'\"'"), Text(""), false), Text("'")); } +public Shell_t Shell$escape_path(Path_t path) +{ + return Shell$escape_text(Path$as_text(&path, false, &Path$info)); +} + public Shell_t Shell$escape_text_array(Array_t texts) { Array_t all_escaped = {}; -- cgit v1.2.3