diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2012-11-25 12:08:35 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-11-26 13:30:52 -0800 |
commit | 37141f27d8e0689fe465d8498656ee6543de3ea5 (patch) | |
tree | c02a561ed1e62e3b7d15615fd9f688e9f760c4c0 /http-push.c | |
parent | 5963c0367f00df0e5eeb761f1ef77a33c8f54c40 (diff) | |
download | git-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.c | 23 |
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, """); - break; - case '<': - strbuf_addstr(&buf, "<"); - break; - case '>': - strbuf_addstr(&buf, ">"); - break; - case '&': - strbuf_addstr(&buf, "&"); - break; - case 0: - return strbuf_detach(&buf, NULL); - } - s++; - } + strbuf_addstr_xml_quoted(&buf, s); return strbuf_detach(&buf, NULL); } |