| 828 | } |
| 829 | |
| 830 | static 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 | |
| 843 | void strbuf_addstr_urlencode(struct strbuf *sb, const char *s, |
| 844 | char_predicate allow_unencoded_fn) |
no test coverage detected