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