diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2012-11-25 12:08:34 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-11-26 13:30:08 -0800 |
commit | 5963c0367f00df0e5eeb761f1ef77a33c8f54c40 (patch) | |
tree | 3868310a0904f0371f649f2ce5490f2be9250003 /strbuf.h | |
parent | d1eded46fa5ed350ff52654103623090101b3ba6 (diff) | |
download | git-5963c0367f00df0e5eeb761f1ef77a33c8f54c40.tar.gz |
Add new function strbuf_add_xml_quoted()
Substantially the same code is present in http-push.c and imap-send.c,
so make a library function out of it.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'strbuf.h')
-rw-r--r-- | strbuf.h | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -102,6 +102,12 @@ extern void strbuf_vaddf(struct strbuf *sb, const char *fmt, va_list ap); extern void strbuf_add_lines(struct strbuf *sb, const char *prefix, const char *buf, size_t size); +/* + * Append s to sb, with the characters '<', '>', '&' and '"' converted + * into XML entities. + */ +extern void strbuf_addstr_xml_quoted(struct strbuf *sb, const char *s); + static inline void strbuf_complete_line(struct strbuf *sb) { if (sb->len && sb->buf[sb->len - 1] != '\n') |