git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 2/2] quote: move comment before sq_quote_buf()

From
Christian Couder <christian.couder@gmail.com>
Date
Oct 7, 2015, 22:05 UTC
Message-ID
<1444255550-27631-2-git-send-email-chriscool@tuxfamily.org>
In-Reply-To
<1444255550-27631-1-git-send-email-chriscool@tuxfamily.org>

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>
---
 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
Previous: Christian CouderNext: Junio C Hamano
Message 2 of 3 in “quote: fix broken sq_quote_buf() related comment”
  1. 1/2 quote: fix broken sq_quote_buf() related commentChristian Couder, Oct 7, 2015
  2. 2/2 quote: move comment before sq_quote_buf()Christian Couder, Oct 7, 2015
  3. Junio C HamanoOct 7, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.