summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-10-15 15:43:44 -0700
committerJunio C Hamano <gitster@pobox.com>2015-10-15 15:43:45 -0700
commit1811f935225db3809345a78c175df47adf034dfa (patch)
treef865bdb9e055bbb4430f5f79d317e8e8d49df0ae
parent633a8bdddf32191ffde532a198f8bb59f4370e26 (diff)
parent44cd91eab2992cbf63c789321f16c087696ce324 (diff)
downloadgit-1811f935225db3809345a78c175df47adf034dfa.tar.gz
Merge branch 'cc/quote-comments'
A no-op code-health maintenance. * cc/quote-comments: quote: move comment before sq_quote_buf() quote: fix broken sq_quote_buf() related comment
-rw-r--r--quote.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/quote.c b/quote.c
index 7920e18e44..fe884d2452 100644
--- a/quote.c
+++ b/quote.c
@@ -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
@@ -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;