Skip to content
Snippets Groups Projects
Commit 119ffa33 authored by Junio C Hamano's avatar Junio C Hamano
Browse files

Merge branch 'cc/quote-comments' into maint

A no-op code-health maintenance.

* cc/quote-comments:
  quote: move comment before sq_quote_buf()
  quote: fix broken sq_quote_buf() related comment
parents 71ae5352 44cd91ea
Branches
Tags
No related merge requests found
...@@ -4,9 +4,15 @@ ...@@ -4,9 +4,15 @@
int quote_path_fully = 1; 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. /* Help to copy the thing properly quoted for the shell safety.
* any single quote is replaced with '\'', any exclamation point * any single quote is replaced with '\'', any exclamation point
* is replaced with '\!', and the whole thing is enclosed in a * is replaced with '\!', and the whole thing is enclosed in a
* single quote pair.
* *
* E.g. * E.g.
* original sq_quote result * original sq_quote result
...@@ -15,11 +21,6 @@ int quote_path_fully = 1; ...@@ -15,11 +21,6 @@ int quote_path_fully = 1;
* a'b ==> a'\''b ==> 'a'\''b' * a'b ==> a'\''b ==> 'a'\''b'
* 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) void sq_quote_buf(struct strbuf *dst, const char *src)
{ {
char *to_free = NULL; char *to_free = NULL;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment