{"thread":{"id":"12549","subject":"[PATCH] unquote_c_style: fix off-by-one.","startedAt":"2008-03-06T21:28:19Z","lastAt":"2008-03-07T21:28:13Z","messageCount":5,"participants":["Pierre Habouzit","Junio C Hamano","Adeodato Simó"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"71280","messageId":"20080306212819.GA10873@artemis.madism.org","threadId":"12549","inReplyTo":null,"subject":"[PATCH] unquote_c_style: fix off-by-one.","fromName":"Pierre Habouzit","fromEmail":"madcoder@debian.org","sentAt":"2008-03-06T21:28:19Z","receivedAt":"2008-03-06T21:28:19Z","isPatch":true,"sender":{"key":"madcoder@debian.org","avatar":"https://avatars.githubusercontent.com/u/44708?v=4"},"body":"Thanks to Adeodato Simò for having caught this.\n\nSigned-off-by: Pierre Habouzit <madcoder@debian.org>\n---\n quote.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/quote.c b/quote.c\nindex d061626..40702f6 100644\n--- a/quote.c\n+++ b/quote.c\n@@ -288,7 +288,7 @@ int unquote_c_style(struct strbuf *sb, const char *quoted, const char **endp)\n \t\tswitch (*quoted++) {\n \t\t  case '\"':\n \t\t\tif (endp)\n-\t\t\t\t*endp = quoted + 1;\n+\t\t\t\t*endp = quoted;\n \t\t\treturn 0;\n \t\t  case '\\\\':\n \t\t\tbreak;\n-- \n1.5.4.3.593.g07854\n"},{"id":"71283","messageId":"7vbq5ra4gu.fsf@gitster.siamese.dyndns.org","threadId":"12549","inReplyTo":"20080306212819.GA10873@artemis.madism.org","subject":"Re: [PATCH] unquote_c_style: fix off-by-one.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-03-06T22:10:41Z","receivedAt":"2008-03-06T22:10:41Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Pierre Habouzit <madcoder@debian.org> writes:\n\n> Thanks to Adeodato Simò for having caught this.\n>\n> Signed-off-by: Pierre Habouzit <madcoder@debian.org>\n\nThanks.  I would have appreciated a comment that said something about what\nexternal breakages this one caused, so that we can have an entry in \"bugs\nfixed\" list.\n\nA quick audit of the existing callers suggests that it is fast-import.\n"},{"id":"71294","messageId":"20080307004401.GA13642@artemis.madism.org","threadId":"12549","inReplyTo":"7vbq5ra4gu.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] unquote_c_style: fix off-by-one.","fromName":"Pierre Habouzit","fromEmail":"madcoder@debian.org","sentAt":"2008-03-07T00:44:01Z","receivedAt":"2008-03-07T00:44:01Z","isPatch":true,"sender":{"key":"madcoder@debian.org","avatar":"https://avatars.githubusercontent.com/u/44708?v=4"},"body":"On Thu, Mar 06, 2008 at 10:10:41PM +0000, Junio C Hamano wrote:\n> Pierre Habouzit <madcoder@debian.org> writes:\n> \n> > Thanks to Adeodato Simò for having caught this.\n> >\n> > Signed-off-by: Pierre Habouzit <madcoder@debian.org>\n> \n> Thanks.  I would have appreciated a comment that said something about what\n> external breakages this one caused, so that we can have an entry in \"bugs\n> fixed\" list.\n> \n> A quick audit of the existing callers suggests that it is fast-import.\n\n  I actually don't really know, Adeodato asked me to look into it\nbecause I was the last that touched it, you have to ask him why he found\nthis :)\n\n  I Cc'd him.\n\n-- \n·O·  Pierre Habouzit\n··O                                                madcoder@debian.org\nOOO                                                http://www.madism.org\n"},{"id":"71341","messageId":"20080307092544.GA22069@chistera.yi.org","threadId":"12549","inReplyTo":"20080307004401.GA13642@artemis.madism.org","subject":"Re: [PATCH] unquote_c_style: fix off-by-one.","fromName":"Adeodato Simó","fromEmail":"dato@net.com.org.es","sentAt":"2008-03-07T09:25:44Z","receivedAt":"2008-03-07T09:25:44Z","isPatch":true,"sender":{"key":"dato@net.com.org.es","avatar":"https://gravatar.com/avatar/952ec7d5d5663eb8baf631b5c37f9c58480a881920dd5f8a2d3a71f969b72b53?d=mp&s=160"},"body":"* Pierre Habouzit [Fri, 07 Mar 2008 01:44:01 +0100]:\n\n> On Thu, Mar 06, 2008 at 10:10:41PM +0000, Junio C Hamano wrote:\n> > Pierre Habouzit <madcoder@debian.org> writes:\n\n> > > Thanks to Adeodato Simò for having caught this.\n\n> > > Signed-off-by: Pierre Habouzit <madcoder@debian.org>\n\n> > Thanks.  I would have appreciated a comment that said something about what\n> > external breakages this one caused, so that we can have an entry in \"bugs\n> > fixed\" list.\n\n> > A quick audit of the existing callers suggests that it is fast-import.\n\nYes, it's fast-import. In particular, trying to rename a file whose name\ncontains spaces:\n\n  R \"file 1.txt\" file 2.txt\n                ^\n                unquote_c_style() eats that space, thus fast-import\n                fails with:\n\n                fatal: Missing space after source: R \"file 1.txt\" file 2.txt\n\nCheers,\n\n-- \nAdeodato Simó                                     dato at net.com.org.es\nDebian Developer                                  adeodato at debian.org\n \n- In Italy, for 30 years under the Borgias they had warfare, terror,\n  murder, bloodshed, but they produced Michelangelo, Leonardo da Vinci,\n  and the Renaissance. In Switzerland they had brotherly love - they had\n  500 years of democracy and peace, and what did that produce? The\n  cuckoo clock.\n                -- Harry Lime in “The Third Man”\n\n"},{"id":"71383","messageId":"7vod9q1axe.fsf@gitster.siamese.dyndns.org","threadId":"12549","inReplyTo":"20080307092544.GA22069@chistera.yi.org","subject":"Re: [PATCH] unquote_c_style: fix off-by-one.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-03-07T21:28:13Z","receivedAt":"2008-03-07T21:28:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Adeodato Simó <dato@net.com.org.es> writes:\n\n> * Pierre Habouzit [Fri, 07 Mar 2008 01:44:01 +0100]:\n>\n>> On Thu, Mar 06, 2008 at 10:10:41PM +0000, Junio C Hamano wrote:\n>> > Pierre Habouzit <madcoder@debian.org> writes:\n>\n>> > > Thanks to Adeodato Simò for having caught this.\n>\n>> > > Signed-off-by: Pierre Habouzit <madcoder@debian.org>\n>\n>> > Thanks.  I would have appreciated a comment that said something about what\n>> > external breakages this one caused, so that we can have an entry in \"bugs\n>> > fixed\" list.\n>\n>> > A quick audit of the existing callers suggests that it is fast-import.\n>\n> Yes, it's fast-import. In particular, trying to rename a file whose name\n> contains spaces:\n>\n>   R \"file 1.txt\" file 2.txt\n>                 ^\n>                 unquote_c_style() eats that space, thus fast-import\n>                 fails with:\n>\n>                 fatal: Missing space after source: R \"file 1.txt\" file 2.txt\n>\n\nThanks.\n"}]}