summaryrefslogtreecommitdiff
path: root/quote.c
diff options
context:
space:
mode:
authorChristian Couder <christian.couder@gmail.com>2015-10-07 22:05:50 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-10-07 22:12:01 (GMT)
commit44cd91eab2992cbf63c789321f16c087696ce324 (patch)
treefe51394de01676af753e9376f97f072a7b6cbd35 /quote.c
parentca9da0d810096e5a2f672b6b9c82a58d1a04ce13 (diff)
downloadgit-44cd91eab2992cbf63c789321f16c087696ce324.zip
git-44cd91eab2992cbf63c789321f16c087696ce324.tar.gz
git-44cd91eab2992cbf63c789321f16c087696ce324.tar.bz2
quote: move comment before sq_quote_buf()
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>
Diffstat (limited to 'quote.c')
-rw-r--r--quote.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/quote.c b/quote.c
index 890885a..fe884d2 100644
--- a/quote.c
+++ b/quote.c
@@ -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
@@ -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;