Skip to content

Commit

Permalink
quote: move comment before sq_quote_buf()
Browse files Browse the repository at this point in the history
A big comment at the beginning of quote.c is really
related to sq_quote_buf(), so let's move it in front
of this function.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Christian Couder authored and Junio C Hamano committed Oct 7, 2015
1 parent ca9da0d commit 44cd91e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions quote.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

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
Expand All @@ -16,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 44cd91e

Please sign in to comment.