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

Function wrap_in_html

imap-send.c:1427–1449  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1425}
1426
1427static void wrap_in_html(struct strbuf *msg)
1428{
1429 struct strbuf buf = STRBUF_INIT;
1430 static const char *content_type = "Content-Type: text/html;\n";
1431 static const char *pre_open = "<pre>\n";
1432 static const char *pre_close = "</pre>\n";
1433 const char *body = strstr(msg->buf, "\n\n");
1434
1435 if (!body)
1436 return; /* Headers but no body; no wrapping needed */
1437
1438 body += 2;
1439
1440 strbuf_add(&buf, msg->buf, body - msg->buf - 1);
1441 strbuf_addstr(&buf, content_type);
1442 strbuf_addch(&buf, '\n');
1443 strbuf_addstr(&buf, pre_open);
1444 strbuf_addstr_xml_quoted(&buf, body);
1445 strbuf_addstr(&buf, pre_close);
1446
1447 strbuf_release(msg);
1448 *msg = buf;
1449}
1450
1451static int count_messages(struct strbuf *all_msgs)
1452{

Callers 2

append_msgs_to_imapFunction · 0.85
curl_append_msgs_to_imapFunction · 0.85

Calls 5

strbuf_addFunction · 0.85
strbuf_addstrFunction · 0.85
strbuf_addchFunction · 0.85
strbuf_addstr_xml_quotedFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by

no test coverage detected