git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] unquote_c_style: fix off-by-one.
@ 2008-03-06 21:28 Pierre Habouzit
  2008-03-06 22:10 ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Pierre Habouzit @ 2008-03-06 21:28 UTC (permalink / raw
  To: Git ML

Thanks to Adeodato Simò for having caught this.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
---
 quote.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/quote.c b/quote.c
index d061626..40702f6 100644
--- a/quote.c
+++ b/quote.c
@@ -288,7 +288,7 @@ int unquote_c_style(struct strbuf *sb, const char *quoted, const char **endp)
 		switch (*quoted++) {
 		  case '"':
 			if (endp)
-				*endp = quoted + 1;
+				*endp = quoted;
 			return 0;
 		  case '\\':
 			break;
-- 
1.5.4.3.593.g07854

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

* Re: [PATCH] unquote_c_style: fix off-by-one.
  2008-03-06 21:28 [PATCH] unquote_c_style: fix off-by-one Pierre Habouzit
@ 2008-03-06 22:10 ` Junio C Hamano
  2008-03-07  0:44   ` Pierre Habouzit
  0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2008-03-06 22:10 UTC (permalink / raw
  To: Pierre Habouzit; +Cc: Git ML

Pierre Habouzit <madcoder@debian.org> writes:

> Thanks to Adeodato Simò for having caught this.
>
> Signed-off-by: Pierre Habouzit <madcoder@debian.org>

Thanks.  I would have appreciated a comment that said something about what
external breakages this one caused, so that we can have an entry in "bugs
fixed" list.

A quick audit of the existing callers suggests that it is fast-import.

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

* Re: [PATCH] unquote_c_style: fix off-by-one.
  2008-03-06 22:10 ` Junio C Hamano
@ 2008-03-07  0:44   ` Pierre Habouzit
  2008-03-07  9:25     ` Adeodato Simó
  0 siblings, 1 reply; 5+ messages in thread
From: Pierre Habouzit @ 2008-03-07  0:44 UTC (permalink / raw
  To: Junio C Hamano; +Cc: Git ML, dato

[-- Attachment #1: Type: text/plain, Size: 836 bytes --]

On Thu, Mar 06, 2008 at 10:10:41PM +0000, Junio C Hamano wrote:
> Pierre Habouzit <madcoder@debian.org> writes:
> 
> > Thanks to Adeodato Simò for having caught this.
> >
> > Signed-off-by: Pierre Habouzit <madcoder@debian.org>
> 
> Thanks.  I would have appreciated a comment that said something about what
> external breakages this one caused, so that we can have an entry in "bugs
> fixed" list.
> 
> A quick audit of the existing callers suggests that it is fast-import.

  I actually don't really know, Adeodato asked me to look into it
because I was the last that touched it, you have to ask him why he found
this :)

  I Cc'd him.

-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [PATCH] unquote_c_style: fix off-by-one.
  2008-03-07  0:44   ` Pierre Habouzit
@ 2008-03-07  9:25     ` Adeodato Simó
  2008-03-07 21:28       ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Adeodato Simó @ 2008-03-07  9:25 UTC (permalink / raw
  To: Pierre Habouzit, Junio C Hamano, Git ML

* Pierre Habouzit [Fri, 07 Mar 2008 01:44:01 +0100]:

> On Thu, Mar 06, 2008 at 10:10:41PM +0000, Junio C Hamano wrote:
> > Pierre Habouzit <madcoder@debian.org> writes:

> > > Thanks to Adeodato Simò for having caught this.

> > > Signed-off-by: Pierre Habouzit <madcoder@debian.org>

> > Thanks.  I would have appreciated a comment that said something about what
> > external breakages this one caused, so that we can have an entry in "bugs
> > fixed" list.

> > A quick audit of the existing callers suggests that it is fast-import.

Yes, it's fast-import. In particular, trying to rename a file whose name
contains spaces:

  R "file 1.txt" file 2.txt
                ^
                unquote_c_style() eats that space, thus fast-import
                fails with:

                fatal: Missing space after source: R "file 1.txt" file 2.txt

Cheers,

-- 
Adeodato Simó                                     dato at net.com.org.es
Debian Developer                                  adeodato at debian.org
 
- In Italy, for 30 years under the Borgias they had warfare, terror,
  murder, bloodshed, but they produced Michelangelo, Leonardo da Vinci,
  and the Renaissance. In Switzerland they had brotherly love - they had
  500 years of democracy and peace, and what did that produce? The
  cuckoo clock.
                -- Harry Lime in “The Third Man”


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

* Re: [PATCH] unquote_c_style: fix off-by-one.
  2008-03-07  9:25     ` Adeodato Simó
@ 2008-03-07 21:28       ` Junio C Hamano
  0 siblings, 0 replies; 5+ messages in thread
From: Junio C Hamano @ 2008-03-07 21:28 UTC (permalink / raw
  To: Adeodato Simó; +Cc: Pierre Habouzit, Git ML

Adeodato Simó <dato@net.com.org.es> writes:

> * Pierre Habouzit [Fri, 07 Mar 2008 01:44:01 +0100]:
>
>> On Thu, Mar 06, 2008 at 10:10:41PM +0000, Junio C Hamano wrote:
>> > Pierre Habouzit <madcoder@debian.org> writes:
>
>> > > Thanks to Adeodato Simò for having caught this.
>
>> > > Signed-off-by: Pierre Habouzit <madcoder@debian.org>
>
>> > Thanks.  I would have appreciated a comment that said something about what
>> > external breakages this one caused, so that we can have an entry in "bugs
>> > fixed" list.
>
>> > A quick audit of the existing callers suggests that it is fast-import.
>
> Yes, it's fast-import. In particular, trying to rename a file whose name
> contains spaces:
>
>   R "file 1.txt" file 2.txt
>                 ^
>                 unquote_c_style() eats that space, thus fast-import
>                 fails with:
>
>                 fatal: Missing space after source: R "file 1.txt" file 2.txt
>

Thanks.

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

end of thread, other threads:[~2008-03-07 21:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-06 21:28 [PATCH] unquote_c_style: fix off-by-one Pierre Habouzit
2008-03-06 22:10 ` Junio C Hamano
2008-03-07  0:44   ` Pierre Habouzit
2008-03-07  9:25     ` Adeodato Simó
2008-03-07 21:28       ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).