{"thread":{"id":"40480","subject":"[PATCH 1/2] quote: fix broken sq_quote_buf() related comment","startedAt":"2015-10-03T19:10:46Z","lastAt":"2015-10-03T19:10:47Z","messageCount":2,"participants":["Christian Couder"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"271068","messageId":"1443899447-8665-1-git-send-email-chriscool@tuxfamily.org","threadId":"40480","inReplyTo":null,"subject":"[PATCH 1/2] quote: fix broken sq_quote_buf() related comment","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2015-10-03T19:10:46Z","receivedAt":"2015-10-03T19:10:46Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Since 77d604c (Enhanced sq_quote(), 10 Oct 2005), the\ncomment at the beginning of quote.c is broken.\nLet's fix it.\n---\n quote.c | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/quote.c b/quote.c\nindex 7920e18..890885a 100644\n--- a/quote.c\n+++ b/quote.c\n@@ -7,6 +7,7 @@ int quote_path_fully = 1;\n /* Help to copy the thing properly quoted for the shell safety.\n  * any single quote is replaced with '\\'', any exclamation point\n  * is replaced with '\\!', and the whole thing is enclosed in a\n+ * single quote pair.\n  *\n  * E.g.\n  *  original     sq_quote     result\n-- \n2.6.0.rc2.23.g0e57679\n"},{"id":"271069","messageId":"1443899447-8665-2-git-send-email-chriscool@tuxfamily.org","threadId":"40480","inReplyTo":"1443899447-8665-1-git-send-email-chriscool@tuxfamily.org","subject":"[PATCH 2/2] quote: move comment before sq_quote_buf()","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2015-10-03T19:10:47Z","receivedAt":"2015-10-03T19:10:47Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"A big comment at the beginning of quote.c is really\nrelated to sq_quote_buf(), so let's move it in front\nof this function.\n---\n quote.c | 10 +++++-----\n 1 file changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/quote.c b/quote.c\nindex 890885a..fe884d2 100644\n--- a/quote.c\n+++ b/quote.c\n@@ -4,6 +4,11 @@\n \n int quote_path_fully = 1;\n \n+static inline int need_bs_quote(char c)\n+{\n+\treturn (c == '\\'' || c == '!');\n+}\n+\n /* Help to copy the thing properly quoted for the shell safety.\n  * any single quote is replaced with '\\'', any exclamation point\n  * is replaced with '\\!', and the whole thing is enclosed in a\n@@ -16,11 +21,6 @@ int quote_path_fully = 1;\n  *  a'b      ==> a'\\''b    ==> 'a'\\''b'\n  *  a!b      ==> a'\\!'b    ==> 'a'\\!'b'\n  */\n-static inline int need_bs_quote(char c)\n-{\n-\treturn (c == '\\'' || c == '!');\n-}\n-\n void sq_quote_buf(struct strbuf *dst, const char *src)\n {\n \tchar *to_free = NULL;\n-- \n2.6.0.rc2.23.g0e57679\n"}]}