Thread (31 messages) flat view 31 messages, 8 authors, 2016-06-15

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

From: Jeff King <hidden>
Date: 2016-06-15 22:48:00

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help