diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-03-16 16:52:00 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-03-16 16:52:00 -0400 |
| commit | b4a0fda409f49c44c3aaee40575b438f0dfbbbe4 (patch) | |
| tree | 47842c922e09786fa57ce4e1fc729e12ae10bdc7 /stdlib/shell.c | |
| parent | b0b2504a947058649ca037ad34b579bb5c43f485 (diff) | |
Fix shell escaping of paths
Diffstat (limited to 'stdlib/shell.c')
| -rw-r--r-- | stdlib/shell.c | 6 |
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 = {}; |
