strbuf_complete_line(out);
}
+void strbuf_addstr_xml_quoted(struct strbuf *buf, const char *s)
+{
+ while (*s) {
+ size_t len = strcspn(s, "\"<>&");
+ strbuf_add(buf, s, len);
+ s += len;
+ switch (*s) {
+ case '"':
+ strbuf_addstr(buf, """);
+ break;
+ case '<':
+ strbuf_addstr(buf, "<");
+ break;
+ case '>':
+ strbuf_addstr(buf, ">");
+ break;
+ case '&':
+ strbuf_addstr(buf, "&");
+ break;
+ case 0:
+ return;
+ }
+ s++;
+ }
+}
+
static int is_rfc3986_reserved(char ch)
{
switch (ch) {