From owner-svn-src-head@FreeBSD.ORG Tue Nov 11 21:37:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 70232F8D; Tue, 11 Nov 2014 21:37:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5AB47FF8; Tue, 11 Nov 2014 21:37:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sABLbLSk025055; Tue, 11 Nov 2014 21:37:21 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sABLbIkk025036; Tue, 11 Nov 2014 21:37:18 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201411112137.sABLbIkk025036@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Tue, 11 Nov 2014 21:37:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274405 - in head/contrib/libxo: . libxo tests/core tests/core/saved X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Nov 2014 21:37:21 -0000 Author: marcel Date: Tue Nov 11 21:37:17 2014 New Revision: 274405 URL: https://svnweb.freebsd.org/changeset/base/274405 Log: Upgrade libxo to 0.1.5 Obtained from: https://github.com/Juniper/libxo Modified: head/contrib/libxo/README.md head/contrib/libxo/configure.ac head/contrib/libxo/libxo/libxo.c head/contrib/libxo/libxo/xoconfig.h head/contrib/libxo/libxo/xoversion.h head/contrib/libxo/tests/core/Makefile.am head/contrib/libxo/tests/core/saved/test_07.J.out head/contrib/libxo/tests/core/saved/test_07.JP.out head/contrib/libxo/tests/core/saved/test_07.X.out head/contrib/libxo/tests/core/saved/test_07.XP.out head/contrib/libxo/tests/core/test_07.c Modified: head/contrib/libxo/README.md ============================================================================== --- head/contrib/libxo/README.md Tue Nov 11 20:40:39 2014 (r274404) +++ head/contrib/libxo/README.md Tue Nov 11 21:37:17 2014 (r274405) @@ -60,3 +60,5 @@ option: View the beautiful documentation at: http://juniper.github.io/libxo/libxo-manual.html + +[![Analytics](https://ga-beacon.appspot.com/UA-56056421-1/Juniper/libxo/Readme)](https://github.com/Juniper/libxo) Modified: head/contrib/libxo/configure.ac ============================================================================== --- head/contrib/libxo/configure.ac Tue Nov 11 20:40:39 2014 (r274404) +++ head/contrib/libxo/configure.ac Tue Nov 11 21:37:17 2014 (r274405) @@ -12,7 +12,7 @@ # AC_PREREQ(2.2) -AC_INIT([libxo], [0.1.4], [phil@juniper.net]) +AC_INIT([libxo], [0.1.5], [phil@juniper.net]) AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability]) # Support silent build rules. Requires at least automake-1.11. Modified: head/contrib/libxo/libxo/libxo.c ============================================================================== --- head/contrib/libxo/libxo/libxo.c Tue Nov 11 20:40:39 2014 (r274404) +++ head/contrib/libxo/libxo/libxo.c Tue Nov 11 21:37:17 2014 (r274405) @@ -79,7 +79,7 @@ struct xo_handle_s { unsigned short xo_indent; /* Indent level (if pretty) */ unsigned short xo_indent_by; /* Indent amount (tab stop) */ xo_write_func_t xo_write; /* Write callback */ - xo_close_func_t xo_close; /* Clo;se callback */ + xo_close_func_t xo_close; /* Close callback */ xo_formatter_t xo_formatter; /* Custom formating function */ xo_checkpointer_t xo_checkpointer; /* Custom formating support function */ void *xo_opaque; /* Opaque data for write function */ @@ -1912,6 +1912,7 @@ xo_format_string (xo_handle_t *xop, xo_b xo_format_t *xfp) { static char null[] = "(null)"; + char *cp = NULL; wchar_t *wcp = NULL; int len, cols = 0, rc = 0; @@ -1922,16 +1923,33 @@ xo_format_string (xo_handle_t *xop, xo_b if (xo_check_conversion(xop, xfp->xf_enc, need_enc)) return 0; + len = xfp->xf_width[XF_WIDTH_SIZE]; + if (xfp->xf_enc == XF_ENC_WIDE) { wcp = va_arg(xop->xo_vap, wchar_t *); if (xfp->xf_skip) return 0; + /* + * Dont' deref NULL; use the traditional "(null)" instead + * of the more accurate "who's been a naughty boy, then?". + */ + if (wcp == NULL) { + cp = null; + len = sizeof(null) - 1; + } + } else { cp = va_arg(xop->xo_vap, char *); /* UTF-8 or native */ if (xfp->xf_skip) return 0; + /* Echo "Dont' deref NULL" logic */ + if (cp == NULL) { + cp = null; + len = sizeof(null) - 1; + } + /* * Optimize the most common case, which is "%s". We just * need to copy the complete string to the output buffer. @@ -1957,17 +1975,6 @@ xo_format_string (xo_handle_t *xop, xo_b } } - len = xfp->xf_width[XF_WIDTH_SIZE]; - - /* - * Dont' deref NULL; use the traditional "(null)" instead - * of the more accurate "who's been a naughty boy, then?". - */ - if (cp == NULL && wcp == NULL) { - cp = null; - len = sizeof(null) - 1; - } - cols = xo_format_string_direct(xop, xbp, flags, wcp, cp, len, xfp->xf_width[XF_WIDTH_MAX], need_enc, xfp->xf_enc); @@ -3859,7 +3866,7 @@ xo_close_list_h (xo_handle_t *xop, const rc = xo_printf(xop, "%s%*s]", pre_nl, xo_indent(xop), ""); xop->xo_stack[xop->xo_depth].xs_flags |= XSF_NOT_FIRST; - return 0; + return rc; } int Modified: head/contrib/libxo/libxo/xoconfig.h ============================================================================== --- head/contrib/libxo/libxo/xoconfig.h Tue Nov 11 20:40:39 2014 (r274404) +++ head/contrib/libxo/libxo/xoconfig.h Tue Nov 11 21:37:17 2014 (r274405) @@ -158,7 +158,7 @@ #define PACKAGE_NAME "libxo" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "libxo 0.1.4" +#define PACKAGE_STRING "libxo 0.1.5" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "libxo" @@ -167,7 +167,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "0.1.4" +#define PACKAGE_VERSION "0.1.5" /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -181,7 +181,7 @@ #define STDC_HEADERS 1 /* Version number of package */ -#define VERSION "0.1.4" +#define VERSION "0.1.5" /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ Modified: head/contrib/libxo/libxo/xoversion.h ============================================================================== --- head/contrib/libxo/libxo/xoversion.h Tue Nov 11 20:40:39 2014 (r274404) +++ head/contrib/libxo/libxo/xoversion.h Tue Nov 11 21:37:17 2014 (r274405) @@ -18,7 +18,7 @@ /** * The version string */ -#define LIBXO_VERSION "0.1.4" +#define LIBXO_VERSION "0.1.5" /** * The version number Modified: head/contrib/libxo/tests/core/Makefile.am ============================================================================== --- head/contrib/libxo/tests/core/Makefile.am Tue Nov 11 20:40:39 2014 (r274404) +++ head/contrib/libxo/tests/core/Makefile.am Tue Nov 11 21:37:17 2014 (r274405) @@ -30,7 +30,7 @@ test_07_test_SOURCES = test_07.c # TEST_CASES := $(shell cd ${srcdir} ; echo *.c ) -bin_PROGRAMS = ${TEST_CASES:.c=.test} +noinst_PROGRAMS = ${TEST_CASES:.c=.test} LDADD = \ ${top_builddir}/libxo/libxo.la @@ -66,7 +66,7 @@ valgrind: TEST_ONE = \ LIBXO_OPTIONS=:W$$fmt \ - ${CHECKER} $$base.test ${TEST_OPTS} \ + ${CHECKER} ./$$base.test ${TEST_OPTS} \ > out/$$base.$$fmt.out 2> out/$$base.$$fmt.err ; \ ${DIFF} -Nu ${srcdir}/saved/$$base.$$fmt.out out/$$base.$$fmt.out ${S2O} ; \ ${DIFF} -Nu ${srcdir}/saved/$$base.$$fmt.err out/$$base.$$fmt.err ${S2O} Modified: head/contrib/libxo/tests/core/saved/test_07.J.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_07.J.out Tue Nov 11 20:40:39 2014 (r274404) +++ head/contrib/libxo/tests/core/saved/test_07.J.out Tue Nov 11 21:37:17 2014 (r274405) @@ -1,2 +1,2 @@ -{"employees": {"v1":"γιγνώσκειν","v2":"ὦ ἄνδρες ᾿Αθηναῖοι","columns":28,"columns":2,"v1":"ახლავე გაიაროთ რეგისტრაცია","v2":"Unicode-ის მეათე საერთაშორისო","columns":55, "employee": ["columns":0, {"first-name":"Jim","nic-name":"\"რეგტ\"","last-name":"გთხოვთ ახ","department":431,"percent-time":90,"columns":23,"benefits":"full"}, {"first-name":"Terry","nic-name":"\"γιγνώσκεινὦ ἄνδρες ᾿Αθηναῖοι282ახლავე გაიაროთ რეგისტრაციაUnicode-ის მეათე საერთაშორისო550Jim"რეგტ"გთხოვთ ახ4319023fullTerry"<one"Οὐχὶ ταὐτὰ παρίσταταί μοι Jones6609047fullLeslie"Les"Patterson3416025fullAshley"Ash"Meter & Smith144040300123456789"0123456789"01234567890123456789014404049ახლა"გაიარო"საერთაშორისო1239029full \ No newline at end of file +(null)γιγνώσκεινὦ ἄνδρες ᾿Αθηναῖοι282ახლავე გაიაროთ რეგისტრაციაUnicode-ის მეათე საერთაშორისო550Jim"რეგტ"გთხოვთ ახ4319023fullTerry"<one"Οὐχὶ ταὐτὰ παρίσταταί μοι Jones6609047fullLeslie"Les "Patterson3416025fullAshley"Ash"Meter & Smith144040300123456789"0123456789"01234567890123456789014404049ახლა"გაიარო"საერთაშორისო1239029full \ No newline at end of file Modified: head/contrib/libxo/tests/core/saved/test_07.XP.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_07.XP.out Tue Nov 11 20:40:39 2014 (r274404) +++ head/contrib/libxo/tests/core/saved/test_07.XP.out Tue Nov 11 21:37:17 2014 (r274405) @@ -1,4 +1,7 @@ + + (null) + γιγνώσκειν ὦ ἄνδρες ᾿Αθηναῖοι 28 Modified: head/contrib/libxo/tests/core/test_07.c ============================================================================== --- head/contrib/libxo/tests/core/test_07.c Tue Nov 11 20:40:39 2014 (r274404) +++ head/contrib/libxo/tests/core/test_07.c Tue Nov 11 21:37:17 2014 (r274405) @@ -52,6 +52,12 @@ main (int argc, char **argv) xo_open_container("employees"); + xo_open_list("test"); + xo_open_instance("test"); + xo_emit("{ek:filename/%s}", NULL); + xo_close_instance("test"); + xo_close_list("test"); + rc = xo_emit("Οὐχὶ ταὐτὰ παρίσταταί μοι {:v1/%s}, {:v2/%s}\n", "γιγνώσκειν", "ὦ ἄνδρες ᾿Αθηναῖοι"); rc = xo_emit("{:columns/%d}\n", rc);