aboutsummaryrefslogtreecommitdiff
path: root/stdlib/shell.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-03-16 16:52:00 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-03-16 16:52:00 -0400
commitb4a0fda409f49c44c3aaee40575b438f0dfbbbe4 (patch)
tree47842c922e09786fa57ce4e1fc729e12ae10bdc7 /stdlib/shell.c
parentb0b2504a947058649ca037ad34b579bb5c43f485 (diff)
Fix shell escaping of paths
Diffstat (limited to 'stdlib/shell.c')
-rw-r--r--stdlib/shell.c6
1 files changed, 6 insertions, 0 deletions
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 = {};