Skip to content

Commit

Permalink
Merge pull request #1812 from EliahKagan/single
Browse files Browse the repository at this point in the history
Clarify description of `single` escaping
  • Loading branch information
Byron authored Jan 26, 2025
2 parents 10937b0 + d731a1c commit 6065af5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gix-quote/src/single.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use bstr::{BStr, BString, ByteSlice, ByteVec};

/// Transforms the given `value` to be suitable for use as an argument for Bourne shells by wrapping it into single quotes.
///
/// Every single-quote `'` is escaped with `\'`, every exclamation mark `!` is escaped with `\!`, and the entire string is enclosed
/// in single quotes.
/// Every single-quote `'` is escaped as `'\''`, every exclamation mark `!` is escaped as `'\!'`,
/// and the entire string is enclosed in single quotes.
pub fn single(mut value: &BStr) -> BString {
let mut quoted = BString::new(b"'".to_vec());

Expand Down

0 comments on commit 6065af5

Please sign in to comment.