svn commit: r319729 - in vendor/Juniper/libxo/dist: . doc libxo
Phil Shafer
phil at FreeBSD.org
Fri Jun 9 03:30:09 UTC 2017
Author: phil
Date: Fri Jun 9 03:30:07 2017
New Revision: 319729
URL: https://svnweb.freebsd.org/changeset/base/319729
Log:
Import libxo 0.8.1
Modified:
vendor/Juniper/libxo/dist/configure.ac
vendor/Juniper/libxo/dist/doc/libxo-manual.html
vendor/Juniper/libxo/dist/libxo/libxo.c
Modified: vendor/Juniper/libxo/dist/configure.ac
==============================================================================
--- vendor/Juniper/libxo/dist/configure.ac Thu Jun 8 23:56:23 2017 (r319728)
+++ vendor/Juniper/libxo/dist/configure.ac Fri Jun 9 03:30:07 2017 (r319729)
@@ -12,7 +12,7 @@
#
AC_PREREQ(2.2)
-AC_INIT([libxo], [0.8.0], [phil at juniper.net])
+AC_INIT([libxo], [0.8.1], [phil at juniper.net])
AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability])
# Support silent build rules. Requires at least automake-1.11.
Modified: vendor/Juniper/libxo/dist/doc/libxo-manual.html
==============================================================================
--- vendor/Juniper/libxo/dist/doc/libxo-manual.html Thu Jun 8 23:56:23 2017 (r319728)
+++ vendor/Juniper/libxo/dist/doc/libxo-manual.html Fri Jun 9 03:30:07 2017 (r319729)
@@ -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>
Modified: vendor/Juniper/libxo/dist/libxo/libxo.c
==============================================================================
--- vendor/Juniper/libxo/dist/libxo/libxo.c Thu Jun 8 23:56:23 2017 (r319728)
+++ vendor/Juniper/libxo/dist/libxo/libxo.c Fri Jun 9 03:30:07 2017 (r319729)
@@ -239,7 +239,6 @@ typedef uint8_t xo_color_t;
#define XO_EFF_CLEAR_BITS XO_EFF_RESET /* Reset gets reset, surprisingly */
typedef uint8_t xo_effect_t;
-typedef uint8_t xo_color_t;
typedef struct xo_colors_s {
xo_effect_t xoc_effects; /* Current effect set */
xo_color_t xoc_col_fg; /* Foreground color */
@@ -685,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);
@@ -1158,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)
@@ -1170,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 */
@@ -1178,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 */
}
/*
@@ -1518,6 +1518,7 @@ xo_warn_hcv (xo_handle_t *xop, int code, int check_war
newfmt[plen++] = ':';
newfmt[plen++] = ' ';
}
+
memcpy(newfmt + plen, fmt, len);
newfmt[len + plen] = '\0';
@@ -1537,6 +1538,7 @@ xo_warn_hcv (xo_handle_t *xop, int code, int check_war
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);
@@ -1549,6 +1551,7 @@ xo_warn_hcv (xo_handle_t *xop, int code, int check_war
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);
@@ -1559,6 +1562,7 @@ xo_warn_hcv (xo_handle_t *xop, int code, int check_war
if (code >= 0) {
const char *msg = strerror(code);
+
if (msg) {
xo_buf_append(xbp, ": ", 2);
xo_buf_append(xbp, msg, strlen(msg));
@@ -1572,6 +1576,7 @@ xo_warn_hcv (xo_handle_t *xop, int code, int check_war
vfprintf(stderr, newfmt, vap);
if (code >= 0) {
const char *msg = strerror(code);
+
if (msg)
fprintf(stderr, ": %s", msg);
}
@@ -1688,6 +1693,7 @@ xo_message_hcv (xo_handle_t *xop, int code, const char
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)) {
@@ -1701,6 +1707,7 @@ xo_message_hcv (xo_handle_t *xop, int code, const char
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);
@@ -1708,6 +1715,7 @@ xo_message_hcv (xo_handle_t *xop, int code, const char
if (need_nl && code > 0) {
const char *msg = strerror(code);
+
if (msg) {
xo_buf_append(xbp, ": ", 2);
xo_buf_append(xbp, msg, strlen(msg));
@@ -1741,6 +1749,7 @@ xo_message_hcv (xo_handle_t *xop, int code, const char
va_copy(va_local, vap);
rc = vsnprintf(bp, bufsiz, fmt, va_local);
}
+
va_end(va_local);
cp = bp + rc;
@@ -1776,6 +1785,7 @@ xo_message_hcv (xo_handle_t *xop, int code, const char
if (need_nl && code > 0) {
const char *msg = strerror(code);
+
if (msg) {
xo_printf(xop, ": %s", msg);
}
@@ -1790,6 +1800,7 @@ xo_message_hcv (xo_handle_t *xop, int code, const char
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);
@@ -2158,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;
More information about the svn-src-vendor
mailing list