git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] quote: fix broken sq_quote_buf() related comment
@ 2015-10-03 19:10 Christian Couder
  2015-10-03 19:10 ` [PATCH 2/2] quote: move comment before sq_quote_buf() Christian Couder
  0 siblings, 1 reply; 2+ messages in thread
From: Christian Couder @ 2015-10-03 19:10 UTC (permalink / raw)
  To: Git; +Cc: Christian Couder

Since 77d604c (Enhanced sq_quote(), 10 Oct 2005), the
comment at the beginning of quote.c is broken.
Let's fix it.
---
 quote.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/quote.c b/quote.c
index 7920e18..890885a 100644
--- a/quote.c
+++ b/quote.c
@@ -7,6 +7,7 @@ int quote_path_fully = 1;
 /* 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
-- 
2.6.0.rc2.23.g0e57679

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 2/2] quote: move comment before sq_quote_buf()
  2015-10-03 19:10 [PATCH 1/2] quote: fix broken sq_quote_buf() related comment Christian Couder
@ 2015-10-03 19:10 ` Christian Couder
  0 siblings, 0 replies; 2+ messages in thread
From: Christian Couder @ 2015-10-03 19:10 UTC (permalink / raw)
  To: Git; +Cc: Christian Couder

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.
---
 quote.c | 10 +++++-----
 1 file 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;
-- 
2.6.0.rc2.23.g0e57679

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-03 19:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-03 19:10 [PATCH 1/2] quote: fix broken sq_quote_buf() related comment Christian Couder
2015-10-03 19:10 ` [PATCH 2/2] quote: move comment before sq_quote_buf() Christian Couder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).