From c85c277415e9b65a963ca1a09be3b0720c748302 Mon Sep 17 00:00:00 2001 From: "Jeffrey C. Ollie" Date: Wed, 8 Jan 2025 13:12:36 -0600 Subject: [PATCH] core: add docs for ShellEscapeWriter --- src/os/shell.zig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/os/shell.zig b/src/os/shell.zig index a9cb61847..23648a82a 100644 --- a/src/os/shell.zig +++ b/src/os/shell.zig @@ -1,6 +1,11 @@ const std = @import("std"); const testing = std.testing; +/// Writer that escapes characters that shells treat specially to reduce the +/// risk of injection attacks or other such weirdness. Specifically excludes +/// linefeeds so that they can be used to delineate lists of file paths. +/// +/// T should be a Zig type that follows the `std.io.Writer` interface. pub fn ShellEscapeWriter(comptime T: type) type { return struct { child_writer: T,