Re: [PATCH 2/3] strbuf: add strbuf_percentquote_buf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jan 13, 2010 at 11:47:18AM -0800, Junio C Hamano wrote:

> As I said, I don't think appending p-quoted version of itself to a string
> makes much sense, but I don't think in-place is too difficult.
> 
> 	strbuf_addbuf_pquote(*dst, *src)
>         {
> 		int len = src->len, i;
> 		for (i = 0; i < len; i++) {
> 			if (src->buf[i] == '%')
>                         	strbuf_addch(dst, '%');
> 			strbuf_addch(dst, src->buf[i]);

Oops, of course. I was still thinking of actually doing a single
in-place conversion, not appending in-place. Of course yours is right.
Can you mark up my patch instead of using the assert?

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]