Re: [PATCH] utf8.c: fix strbuf_utf8_replace copying the last NUL to dst string

2014-07-30 Thread Junio C Hamano
Duy Nguyen writes: >> > it returns 0 and steps 'src' by one. >> >> Here "it" refers to utf8_width()? Who steps 'src' by one? > > utf8_width() steps 'src'. > >> >> Ahh, did you mean *src == NUL, i.e. "already at the end of the >> string"? > > Yes.. I guess you have a better commit message prep

Re: [PATCH] utf8.c: fix strbuf_utf8_replace copying the last NUL to dst string

2014-07-30 Thread Duy Nguyen
On Tue, Jul 29, 2014 at 12:56:24PM -0700, Junio C Hamano wrote: > Nguyễn Thái Ngọc Duy writes: > > > When utf8_width(&src) is called with *src == NULL (because the > > source string ends with an ansi sequence), > > I am not sure what you mean by "because" here. Do you mean somebody > (who?) de

Re: [PATCH] utf8.c: fix strbuf_utf8_replace copying the last NUL to dst string

2014-07-29 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > When utf8_width(&src) is called with *src == NULL (because the > source string ends with an ansi sequence), I am not sure what you mean by "because" here. Do you mean somebody (who?) decides to call the utf8_width() with NULL pointer stored in *src because of "an