MCPcopy Create free account
hub / github.com/git/git / strbuf_add_urlencode

Function strbuf_add_urlencode

strbuf.c:830–841  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

828}
829
830static void strbuf_add_urlencode(struct strbuf *sb, const char *s, size_t len,
831 char_predicate allow_unencoded_fn)
832{
833 strbuf_grow(sb, len);
834 while (len--) {
835 char ch = *s++;
836 if (allow_unencoded_fn(ch))
837 strbuf_addch(sb, ch);
838 else
839 strbuf_addf(sb, "%%%02x", (unsigned char)ch);
840 }
841}
842
843void strbuf_addstr_urlencode(struct strbuf *sb, const char *s,
844 char_predicate allow_unencoded_fn)

Callers 1

strbuf_addstr_urlencodeFunction · 0.85

Calls 3

strbuf_growFunction · 0.85
strbuf_addchFunction · 0.85
strbuf_addfFunction · 0.85

Tested by

no test coverage detected