Skip to content

Commit

Permalink
core: add docs for ShellEscapeWriter
Browse files Browse the repository at this point in the history
  • Loading branch information
jcollie committed Jan 8, 2025
1 parent e7c71df commit c85c277
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/os/shell.zig
Original file line number Diff line number Diff line change
@@ -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,
Expand Down

0 comments on commit c85c277

Please sign in to comment.