aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Shafer <phil@FreeBSD.org>2017-06-09 03:32:49 +0000
committerPhil Shafer <phil@FreeBSD.org>2017-06-09 03:32:49 +0000
commit2f78413036dbd2525302e09a9457b32353a8e1ae (patch)
tree797e6e1a9a7f4e751ae506ec3e2f08f07a137012
parent6720b890459dccaf6da00d7a30fe63d01b0eac7b (diff)
parent4d0cf5aca3fe69e3abb9719b9dc74d3daf4643f8 (diff)
downloadsrc-2f78413036dbd2525302e09a9457b32353a8e1ae.tar.gz
src-2f78413036dbd2525302e09a9457b32353a8e1ae.zip
Import libxo-0.8.1 with official fix to today's build break.
Submitted by: phil
Notes
Notes: svn path=/head/; revision=319731
-rw-r--r--contrib/libxo/configure.ac2
-rw-r--r--contrib/libxo/doc/libxo-manual.html2
-rw-r--r--contrib/libxo/libxo/libxo.c19
-rw-r--r--lib/libxo/add.man4
-rw-r--r--lib/libxo/xo_config.h12
5 files changed, 26 insertions, 13 deletions
diff --git a/contrib/libxo/configure.ac b/contrib/libxo/configure.ac
index 3deb765f357f..1cf91469a025 100644
--- a/contrib/libxo/configure.ac
+++ b/contrib/libxo/configure.ac
@@ -12,7 +12,7 @@
#
AC_PREREQ(2.2)
-AC_INIT([libxo], [0.8.0], [phil@juniper.net])
+AC_INIT([libxo], [0.8.1], [phil@juniper.net])
AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability])
# Support silent build rules. Requires at least automake-1.11.
diff --git a/contrib/libxo/doc/libxo-manual.html b/contrib/libxo/doc/libxo-manual.html
index e25445543ecb..c7577b922678 100644
--- a/contrib/libxo/doc/libxo-manual.html
+++ b/contrib/libxo/doc/libxo-manual.html
@@ -22011,7 +22011,7 @@ jQuery(function ($) {
</tr>
<tr>
<td class="header left"></td>
-<td class="header right">June 3, 2017</td>
+<td class="header right">June 8, 2017</td>
</tr>
</table></div>
<p id="title" class="title">libxo: The Easy Way to Generate text, XML, JSON, and HTML output<br><span class="filename">libxo-manual</span></p>
diff --git a/contrib/libxo/libxo/libxo.c b/contrib/libxo/libxo/libxo.c
index 9f1b3da8a619..7f015b7b2dcf 100644
--- a/contrib/libxo/libxo/libxo.c
+++ b/contrib/libxo/libxo/libxo.c
@@ -684,6 +684,7 @@ xo_default_init (void)
#if !defined(NO_LIBXO_OPTIONS)
if (!XOF_ISSET(xop, XOF_NO_ENV)) {
char *env = getenv("LIBXO_OPTIONS");
+
if (env)
xo_set_options_simple(xop, env);
@@ -1157,7 +1158,7 @@ xo_utf8_emit_len (wchar_t wc)
}
/*
- * Emit a single wide character into the given buffer
+ * Emit one wide character into the given buffer
*/
static void
xo_utf8_emit_char (char *buf, ssize_t len, wchar_t wc)
@@ -1169,7 +1170,7 @@ xo_utf8_emit_char (char *buf, ssize_t len, wchar_t wc)
return;
}
- /* Start with the low bits and insert them, six bits as a time */
+ /* Start with the low bits and insert them, six bits at a time */
for (i = len - 1; i >= 0; i--) {
buf[i] = 0x80 | (wc & 0x3f);
wc >>= 6; /* Drop the low six bits */
@@ -1177,7 +1178,7 @@ xo_utf8_emit_char (char *buf, ssize_t len, wchar_t wc)
/* Finish off the first byte with the length bits */
buf[0] &= xo_utf8_data_bits[len]; /* Clear out the length bits */
- buf[0] |= xo_utf8_len_bits[len]; /* Drop in new length bits */
+ buf[0] |= xo_utf8_len_bits[len]; /* Drop in new length bits */
}
/*
@@ -1517,6 +1518,7 @@ xo_warn_hcv (xo_handle_t *xop, int code, int check_warn,
newfmt[plen++] = ':';
newfmt[plen++] = ' ';
}
+
memcpy(newfmt + plen, fmt, len);
newfmt[len + plen] = '\0';
@@ -1536,6 +1538,7 @@ xo_warn_hcv (xo_handle_t *xop, int code, int check_warn,
ssize_t left = xbp->xb_size - (xbp->xb_curp - xbp->xb_bufp);
ssize_t rc = vsnprintf(xbp->xb_curp, left, newfmt, vap);
+
if (rc >= left) {
if (!xo_buf_has_room(xbp, rc)) {
va_end(va_local);
@@ -1548,6 +1551,7 @@ xo_warn_hcv (xo_handle_t *xop, int code, int check_warn,
left = xbp->xb_size - (xbp->xb_curp - xbp->xb_bufp);
rc = vsnprintf(xbp->xb_curp, left, fmt, vap);
}
+
va_end(va_local);
rc = xo_escape_xml(xbp, rc, 1);
@@ -1558,6 +1562,7 @@ xo_warn_hcv (xo_handle_t *xop, int code, int check_warn,
if (code >= 0) {
const char *msg = strerror(code);
+
if (msg) {
xo_buf_append(xbp, ": ", 2);
xo_buf_append(xbp, msg, strlen(msg));
@@ -1571,6 +1576,7 @@ xo_warn_hcv (xo_handle_t *xop, int code, int check_warn,
vfprintf(stderr, newfmt, vap);
if (code >= 0) {
const char *msg = strerror(code);
+
if (msg)
fprintf(stderr, ": %s", msg);
}
@@ -1687,6 +1693,7 @@ xo_message_hcv (xo_handle_t *xop, int code, const char *fmt, va_list vap)
va_copy(va_local, vap);
ssize_t left = xbp->xb_size - (xbp->xb_curp - xbp->xb_bufp);
+
rc = vsnprintf(xbp->xb_curp, left, fmt, vap);
if (rc >= left) {
if (!xo_buf_has_room(xbp, rc)) {
@@ -1700,6 +1707,7 @@ xo_message_hcv (xo_handle_t *xop, int code, const char *fmt, va_list vap)
left = xbp->xb_size - (xbp->xb_curp - xbp->xb_bufp);
rc = vsnprintf(xbp->xb_curp, left, fmt, vap);
}
+
va_end(va_local);
rc = xo_escape_xml(xbp, rc, 0);
@@ -1707,6 +1715,7 @@ xo_message_hcv (xo_handle_t *xop, int code, const char *fmt, va_list vap)
if (need_nl && code > 0) {
const char *msg = strerror(code);
+
if (msg) {
xo_buf_append(xbp, ": ", 2);
xo_buf_append(xbp, msg, strlen(msg));
@@ -1740,6 +1749,7 @@ xo_message_hcv (xo_handle_t *xop, int code, const char *fmt, va_list vap)
va_copy(va_local, vap);
rc = vsnprintf(bp, bufsiz, fmt, va_local);
}
+
va_end(va_local);
cp = bp + rc;
@@ -1775,6 +1785,7 @@ xo_message_hcv (xo_handle_t *xop, int code, const char *fmt, va_list vap)
if (need_nl && code > 0) {
const char *msg = strerror(code);
+
if (msg) {
xo_printf(xop, ": %s", msg);
}
@@ -1789,6 +1800,7 @@ xo_message_hcv (xo_handle_t *xop, int code, const char *fmt, va_list vap)
case XO_STYLE_HTML:
if (XOIF_ISSET(xop, XOIF_DIV_OPEN)) {
static char div_close[] = "</div>";
+
XOIF_CLEAR(xop, XOIF_DIV_OPEN);
xo_data_append(xop, div_close, sizeof(div_close) - 1);
@@ -2157,6 +2169,7 @@ xo_set_style_name (xo_handle_t *xop, const char *name)
return -1;
int style = xo_name_to_style(name);
+
if (style < 0)
return -1;
diff --git a/lib/libxo/add.man b/lib/libxo/add.man
index bc9ed70b4b4d..769629f6ae66 100644
--- a/lib/libxo/add.man
+++ b/lib/libxo/add.man
@@ -3,10 +3,10 @@
.Fx
uses
.Nm libxo
-version 0.8.0.
+version 0.8.1.
Complete documentation can be found on github:
.Bd -literal -offset indent
-http://juniper.github.io/libxo/0.8.0/libxo\-manual.html
+http://juniper.github.io/libxo/0.8.1/libxo\-manual.html
.Ed
.Pp
.Nm libxo
diff --git a/lib/libxo/xo_config.h b/lib/libxo/xo_config.h
index 2774a9202d1d..e9536ea1b69e 100644
--- a/lib/libxo/xo_config.h
+++ b/lib/libxo/xo_config.h
@@ -183,16 +183,16 @@
/* #undef LIBXO_TEXT_ONLY */
/* Version number as dotted value */
-#define LIBXO_VERSION "0.8.0"
+#define LIBXO_VERSION "0.8.1"
/* Version number extra information */
#define LIBXO_VERSION_EXTRA ""
/* Version number as a number */
-#define LIBXO_VERSION_NUMBER 8000
+#define LIBXO_VERSION_NUMBER 8001
/* Version number as string */
-#define LIBXO_VERSION_STRING "8000"
+#define LIBXO_VERSION_STRING "8001"
/* Enable local wcwidth implementation */
#define LIBXO_WCWIDTH 1
@@ -210,7 +210,7 @@
#define PACKAGE_NAME "libxo"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "libxo 0.8.0"
+#define PACKAGE_STRING "libxo 0.8.1"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "libxo"
@@ -219,7 +219,7 @@
#define PACKAGE_URL ""
/* Define to the version of this package. */
-#define PACKAGE_VERSION "0.8.0"
+#define PACKAGE_VERSION "0.8.1"
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
@@ -236,7 +236,7 @@
/* #undef USE_INT_RETURN_CODES */
/* Version number of package */
-#define VERSION "0.8.0"
+#define VERSION "0.8.1"
/* Retain hash bucket size */
/* #undef XO_RETAIN_SIZE */