aboutsummaryrefslogtreecommitdiffstats
path: root/libxo/libxo.c
diff options
context:
space:
mode:
authorPhil Shafer <phil@FreeBSD.org>2016-04-15 15:42:12 +0000
committerPhil Shafer <phil@FreeBSD.org>2016-04-15 15:42:12 +0000
commit4fde2bf0a5c2be74f596489a57fd30c9810b1c4d (patch)
treee06554b069a40318907ab918e557b702a251b84e /libxo/libxo.c
parent65e9b9c344edf99c234e6e6ce60d0267607814ad (diff)
downloadsrc-4fde2bf0a5c2be74f596489a57fd30c9810b1c4d.tar.gz
src-4fde2bf0a5c2be74f596489a57fd30c9810b1c4d.zip
Import libxo 0.4.7vendor/Juniper/libxo/0.4.7
Notes
Notes: svn path=/vendor/Juniper/libxo/dist/; revision=298063 svn path=/vendor/Juniper/libxo/0.4.7/; revision=298064; tag=vendor/Juniper/libxo/0.4.7
Diffstat (limited to 'libxo/libxo.c')
-rw-r--r--libxo/libxo.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/libxo/libxo.c b/libxo/libxo.c
index cceebfa3a3d7..bae810f179c7 100644
--- a/libxo/libxo.c
+++ b/libxo/libxo.c
@@ -3374,6 +3374,15 @@ xo_buf_append_div (xo_handle_t *xop, const char *class, xo_xff_flags_t flags,
static char div_end[] = "\">";
static char div_close[] = "</div>";
+ /* The encoding format defaults to the normal format */
+ if (encoding == NULL) {
+ char *enc = alloca(vlen + 1);
+ memcpy(enc, value, vlen);
+ enc[vlen] = '\0';
+ encoding = xo_fix_encoding(xop, enc);
+ elen = strlen(encoding);
+ }
+
/*
* To build our XPath predicate, we need to save the va_list before
* we format our data, and then restore it before we format the
@@ -3406,15 +3415,6 @@ xo_buf_append_div (xo_handle_t *xop, const char *class, xo_xff_flags_t flags,
else
xo_buf_append(pbp, "='", 2);
- /* The encoding format defaults to the normal format */
- if (encoding == NULL) {
- char *enc = alloca(vlen + 1);
- memcpy(enc, value, vlen);
- enc[vlen] = '\0';
- encoding = xo_fix_encoding(xop, enc);
- elen = strlen(encoding);
- }
-
xo_xff_flags_t pflags = flags | XFF_XML | XFF_ATTR;
pflags &= ~(XFF_NO_OUTPUT | XFF_ENCODE_ONLY);
xo_do_format_field(xop, pbp, encoding, elen, pflags);