summaryrefslogtreecommitdiff
path: root/http-push.c
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2012-11-25 12:08:35 +0100
committerJunio C Hamano <gitster@pobox.com>2012-11-26 13:30:52 -0800
commit37141f27d8e0689fe465d8498656ee6543de3ea5 (patch)
treec02a561ed1e62e3b7d15615fd9f688e9f760c4c0 /http-push.c
parent5963c0367f00df0e5eeb761f1ef77a33c8f54c40 (diff)
downloadgit-37141f27d8e0689fe465d8498656ee6543de3ea5.tar.gz
xml_entities(): use function strbuf_addstr_xml_quoted()
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'http-push.c')
-rw-r--r--http-push.c23
1 files changed, 1 insertions, 22 deletions
diff --git a/http-push.c b/http-push.c
index 8701c1215d..9923441a4e 100644
--- a/http-push.c
+++ b/http-push.c
@@ -172,28 +172,7 @@ enum dav_header_flag {
static char *xml_entities(const char *s)
{
struct strbuf buf = STRBUF_INIT;
- while (*s) {
- size_t len = strcspn(s, "\"<>&");
- strbuf_add(&buf, s, len);
- s += len;
- switch (*s) {
- case '"':
- strbuf_addstr(&buf, "&quot;");
- break;
- case '<':
- strbuf_addstr(&buf, "&lt;");
- break;
- case '>':
- strbuf_addstr(&buf, "&gt;");
- break;
- case '&':
- strbuf_addstr(&buf, "&amp;");
- break;
- case 0:
- return strbuf_detach(&buf, NULL);
- }
- s++;
- }
+ strbuf_addstr_xml_quoted(&buf, s);
return strbuf_detach(&buf, NULL);
}