Skip to content

Commit

Permalink
Merge branch 'cc/quote-comments' into maint
Browse files Browse the repository at this point in the history
A no-op code-health maintenance.

* cc/quote-comments:
  quote: move comment before sq_quote_buf()
  quote: fix broken sq_quote_buf() related comment
  • Loading branch information
Junio C Hamano committed Oct 16, 2015
2 parents 71ae535 + 44cd91e commit 119ffa3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions quote.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@

int quote_path_fully = 1;

static inline int need_bs_quote(char c)
{
return (c == '\'' || c == '!');
}

/* Help to copy the thing properly quoted for the shell safety.
* any single quote is replaced with '\'', any exclamation point
* is replaced with '\!', and the whole thing is enclosed in a
* single quote pair.
*
* E.g.
* original sq_quote result
Expand All @@ -15,11 +21,6 @@ int quote_path_fully = 1;
* a'b ==> a'\''b ==> 'a'\''b'
* a!b ==> a'\!'b ==> 'a'\!'b'
*/
static inline int need_bs_quote(char c)
{
return (c == '\'' || c == '!');
}

void sq_quote_buf(struct strbuf *dst, const char *src)
{
char *to_free = NULL;
Expand Down

0 comments on commit 119ffa3

Please sign in to comment.