Hello community, here is the log from the commit of package libfilezilla for openSUSE:Factory checked in at 2018-05-10 15:48:34 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libfilezilla (Old) and /work/SRC/openSUSE:Factory/.libfilezilla.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libfilezilla" Thu May 10 15:48:34 2018 rev:17 rq:605297 version:0.12.2 Changes: -------- --- /work/SRC/openSUSE:Factory/libfilezilla/libfilezilla.changes 2018-02-24 16:40:27.359125139 +0100 +++ /work/SRC/openSUSE:Factory/.libfilezilla.new/libfilezilla.changes 2018-05-10 15:48:37.942951690 +0200 @@ -1,0 +2,11 @@ +Tue May 8 10:52:07 UTC 2018 - [email protected] + +- update to 0.12.2 + * New features: + - Added parameters to base64_encode to control alphabet and + padding + - Improved performance of less_insensitive_ascii + - *nix: Faster conversion between UTF-8 and wchar_t strings. + + +------------------------------------------------------------------- Old: ---- libfilezilla-0.12.1.tar.bz2 New: ---- libfilezilla-0.12.2.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libfilezilla.spec ++++++ --- /var/tmp/diff_new_pack.o9zDNk/_old 2018-05-10 15:48:38.534929993 +0200 +++ /var/tmp/diff_new_pack.o9zDNk/_new 2018-05-10 15:48:38.538929846 +0200 @@ -20,7 +20,7 @@ %define libname %{name}%{major} %define develname %{name}-devel Name: libfilezilla -Version: 0.12.1 +Version: 0.12.2 Release: 0 Summary: C++ library for filezilla License: GPL-2.0+ ++++++ libfilezilla-0.12.1.tar.bz2 -> libfilezilla-0.12.2.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.12.1/NEWS new/libfilezilla-0.12.2/NEWS --- old/libfilezilla-0.12.1/NEWS 2018-02-23 09:29:01.000000000 +0100 +++ new/libfilezilla-0.12.2/NEWS 2018-05-06 11:47:12.000000000 +0200 @@ -1,3 +1,9 @@ +0.12.2 (2018-05-05) + ++ Added parameters to base64_encode to control alphabet and padding ++ Improved performance of less_insensitive_ascii ++ *nix: Faster conversion between UTF-8 and wchar_t strings. + 0.12.1 (2018-02-23) + Added fz::buffer::operator== and operator!= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.12.1/configure new/libfilezilla-0.12.2/configure --- old/libfilezilla-0.12.1/configure 2018-02-23 09:29:12.000000000 +0100 +++ new/libfilezilla-0.12.2/configure 2018-05-06 11:22:50.000000000 +0200 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for libfilezilla 0.12.1. +# Generated by GNU Autoconf 2.69 for libfilezilla 0.12.2. # # Report bugs to <[email protected]>. # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='libfilezilla' PACKAGE_TARNAME='libfilezilla' -PACKAGE_VERSION='0.12.1' -PACKAGE_STRING='libfilezilla 0.12.1' +PACKAGE_VERSION='0.12.2' +PACKAGE_STRING='libfilezilla 0.12.2' PACKAGE_BUGREPORT='[email protected]' PACKAGE_URL='https://lib.filezilla-project.org/' @@ -1413,7 +1413,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libfilezilla 0.12.1 to adapt to many kinds of systems. +\`configure' configures libfilezilla 0.12.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1484,7 +1484,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libfilezilla 0.12.1:";; + short | recursive ) echo "Configuration of libfilezilla 0.12.2:";; esac cat <<\_ACEOF @@ -1621,7 +1621,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libfilezilla configure 0.12.1 +libfilezilla configure 0.12.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2066,7 +2066,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libfilezilla $as_me 0.12.1, which was +It was created by libfilezilla $as_me 0.12.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2932,7 +2932,7 @@ # Define the identity of the package. PACKAGE='libfilezilla' - VERSION='0.12.1' + VERSION='0.12.2' cat >>confdefs.h <<_ACEOF @@ -20908,7 +20908,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libfilezilla $as_me 0.12.1, which was +This file was extended by libfilezilla $as_me 0.12.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -20975,7 +20975,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -libfilezilla config.status 0.12.1 +libfilezilla config.status 0.12.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.12.1/configure.ac new/libfilezilla-0.12.2/configure.ac --- old/libfilezilla-0.12.1/configure.ac 2018-02-23 09:29:01.000000000 +0100 +++ new/libfilezilla-0.12.2/configure.ac 2018-05-06 11:22:43.000000000 +0200 @@ -1,4 +1,4 @@ -AC_INIT([libfilezilla],[0.12.1],[[email protected]],[],[https://lib.filezilla-project.org/]) +AC_INIT([libfilezilla],[0.12.2],[[email protected]],[],[https://lib.filezilla-project.org/]) AC_CONFIG_HEADERS([lib/libfilezilla/private/config.hpp]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_AUX_DIR(config) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.12.1/lib/encode.cpp new/libfilezilla-0.12.2/lib/encode.cpp --- old/libfilezilla-0.12.1/lib/encode.cpp 2017-07-10 19:43:37.000000000 +0200 +++ new/libfilezilla-0.12.2/lib/encode.cpp 2018-05-06 11:22:43.000000000 +0200 @@ -1,9 +1,12 @@ #include "libfilezilla/encode.hpp" namespace fz { -std::string base64_encode(std::string const& in) +std::string base64_encode(std::string const& in, base64_type type, bool pad) { - std::string::value_type const base64_chars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + std::string::value_type const* const base64_chars = + (type == base64_type::standard) + ? "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" + : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; std::string ret; @@ -33,9 +36,13 @@ } else { ret += base64_chars[(c1 & 0x3u) << 4]; + if (pad) { + ret += '='; + } + } + if (pad) { ret += '='; } - ret += '='; } return ret; @@ -47,10 +54,10 @@ { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x80, 0xff, 0x80, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3e, 0xff, 0xff, 0xff, 0x3f, + 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3e, 0xff, 0x3e, 0xff, 0x3f, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0xff, 0xff, 0xff, 0x40, 0xff, 0xff, 0xff, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, - 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, @@ -81,7 +88,7 @@ return c; } } - return static_cast<unsigned char>(0xffu); + return static_cast<unsigned char>(0x40u); }; while (pos < len) { @@ -90,7 +97,10 @@ auto c3 = next(); auto c4 = next(); - if (c1 == 0xff || c2 == 0xff || c3 == 0xff || c4 == 0xff || c1 == 0x40 || c2 == 0x40) { + if (c1 == 0xff || c1 == 0x40 || + c2 == 0xff || c2 == 0x40 || + c3 == 0xff || c4 == 0xff) + { // Bad input return std::string(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.12.1/lib/libfilezilla/encode.hpp new/libfilezilla-0.12.2/lib/libfilezilla/encode.hpp --- old/libfilezilla-0.12.1/lib/libfilezilla/encode.hpp 2017-09-29 10:41:58.000000000 +0200 +++ new/libfilezilla-0.12.2/lib/libfilezilla/encode.hpp 2018-05-06 11:22:43.000000000 +0200 @@ -85,10 +85,25 @@ return ret; } +/** + * \brief Alphabet variations for base64 + * + * - standard: Alphabet with / and + as chars 62 and 63 + * - url: - and _ + */ +enum class base64_type { + standard, + url +}; + /// \brief Encodes raw input string to base64 -std::string FZ_PUBLIC_SYMBOL base64_encode(std::string const& in); +std::string FZ_PUBLIC_SYMBOL base64_encode(std::string const& in, base64_type type = base64_type::standard, bool pad = true); -/// \brief Decodes base64, ignores whitespace. Returns empty string on invalid input. +/** + * \brief Decodes base64, ignores whitespace. Returns empty string on invalid input. + * + * Padding is optional, alphabet is auto-detected. + */ std::string FZ_PUBLIC_SYMBOL base64_decode(std::string const& in); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.12.1/lib/libfilezilla/string.hpp new/libfilezilla-0.12.2/lib/libfilezilla/string.hpp --- old/libfilezilla-0.12.1/lib/libfilezilla/string.hpp 2018-02-16 12:47:48.000000000 +0100 +++ new/libfilezilla-0.12.2/lib/libfilezilla/string.hpp 2018-05-06 11:22:43.000000000 +0200 @@ -128,7 +128,11 @@ { template<typename T> bool operator()(T const& lhs, T const& rhs) const { - return fz::str_tolower_ascii(lhs) < fz::str_tolower_ascii(rhs); + return std::lexicographical_compare(lhs.cbegin(), lhs.cend(), rhs.cbegin(), rhs.cend(), + [](typename T::value_type const& a, typename T::value_type const& b) { + return tolower_ascii(a) < tolower_ascii(b); + } + ); } }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.12.1/lib/libfilezilla/version.hpp new/libfilezilla-0.12.2/lib/libfilezilla/version.hpp --- old/libfilezilla-0.12.1/lib/libfilezilla/version.hpp 2018-02-23 09:29:14.000000000 +0100 +++ new/libfilezilla-0.12.2/lib/libfilezilla/version.hpp 2018-05-06 11:22:53.000000000 +0200 @@ -9,15 +9,15 @@ #include <tuple> /// \brief Version string of the libfilezilla headers -#define LIBFILEZILLA_VERSION "0.12.1" +#define LIBFILEZILLA_VERSION "0.12.2" #define LIBFILEZILLA_VERSION_MAJOR 0 #define LIBFILEZILLA_VERSION_MINOR 12 -#define LIBFILEZILLA_VERSION_MICRO 1 +#define LIBFILEZILLA_VERSION_MICRO 2 #define LIBFILEZILLA_VERSION_NANO 0 /// \brief Suffix string, e.g. "rc1" -#define LIBFILEZILLA_VERSION_SUFFIX "0.12.1" +#define LIBFILEZILLA_VERSION_SUFFIX "0.12.2" namespace fz { /// \brief Get version string of libfilezilla diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.12.1/lib/string.cpp new/libfilezilla-0.12.2/lib/string.cpp --- old/libfilezilla-0.12.1/lib/string.cpp 2017-10-30 18:14:16.000000000 +0100 +++ new/libfilezilla-0.12.2/lib/string.cpp 2018-05-06 11:22:43.000000000 +0200 @@ -126,7 +126,7 @@ // Explicitly specify endianess, otherwise we'll get a BOM prefixed to everything int const i = 1; char const* p = reinterpret_cast<char const*>(&i); - bool little_endian = p[0] == 1; + bool const little_endian = p[0] == 1; if (sizeof(wchar_t) == 4) { if (little_endian && try_encoding("UTF-32LE")) { @@ -155,6 +155,31 @@ static char const* const encoding = calc_wchar_t_encoding(); return encoding; } + +class iconv_t_holder +{ +public: + iconv_t_holder(char const* to, char const* from) + { + cd = iconv_open(to, from); + } + + ~iconv_t_holder() + { + if (cd != reinterpret_cast<iconv_t>(-1)) { + iconv_close(cd); + } + } + + explicit operator bool() const { + return cd != reinterpret_cast<iconv_t>(-1); + } + + iconv_t_holder(iconv_t_holder const&) = delete; + iconv_t_holder& operator=(iconv_t_holder const&) = delete; + + iconv_t cd{reinterpret_cast<iconv_t>(-1)}; +}; } #endif @@ -177,14 +202,15 @@ MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, in_p, static_cast<int>(len), out_p, out_len); } #else - iconv_t cd = iconv_open(wchar_t_encoding(), "UTF-8"); - if (cd != reinterpret_cast<iconv_t>(-1)) { + static thread_local iconv_t_holder holder(wchar_t_encoding(), "UTF-8"); + + if (holder && iconv(holder.cd, nullptr, nullptr, nullptr, nullptr) != static_cast<size_t>(-1)) { auto in_p = const_cast<iconv_second_arg_type>(s); size_t out_len = len * sizeof(wchar_t) * 2; char* out_buf = new char[out_len]; char* out_p = out_buf; - size_t r = iconv(cd, &in_p, &len, &out_p, &out_len); + size_t r = iconv(holder.cd, &in_p, &len, &out_p, &out_len); if (r != static_cast<size_t>(-1)) { ret.assign(reinterpret_cast<wchar_t*>(out_buf), reinterpret_cast<wchar_t*>(out_p)); @@ -193,8 +219,6 @@ // Our buffer should big enough as well, so we can ignore errors such as E2BIG. delete [] out_buf; - - iconv_close(cd); } #endif } @@ -239,8 +263,9 @@ WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, in_p, static_cast<int>(in.size()), out_p, len, nullptr, nullptr); } #else - iconv_t cd = iconv_open("UTF-8", wchar_t_encoding()); - if (cd != reinterpret_cast<iconv_t>(-1)) { + static thread_local iconv_t_holder holder("UTF-8", wchar_t_encoding()); + + if (holder && iconv(holder.cd, nullptr, nullptr, nullptr, nullptr) != static_cast<size_t>(-1)) { auto in_p = reinterpret_cast<iconv_second_arg_type>(const_cast<wchar_t*>(in.c_str())); size_t in_len = in.size() * sizeof(wchar_t); @@ -248,7 +273,7 @@ char* out_buf = new char[out_len]; char* out_p = out_buf; - size_t r = iconv(cd, &in_p, &in_len, &out_p, &out_len); + size_t r = iconv(holder.cd, &in_p, &in_len, &out_p, &out_len); if (r != static_cast<size_t>(-1)) { ret.assign(out_buf, out_p); @@ -257,8 +282,6 @@ // Our buffer should big enough as well, so we can ignore errors such as E2BIG. delete[] out_buf; - - iconv_close(cd); } #endif } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.12.1/tests/string.cpp new/libfilezilla-0.12.2/tests/string.cpp --- old/libfilezilla-0.12.1/tests/string.cpp 2017-07-10 19:43:37.000000000 +0200 +++ new/libfilezilla-0.12.2/tests/string.cpp 2018-05-06 11:22:43.000000000 +0200 @@ -92,8 +92,15 @@ CPPUNIT_ASSERT_EQUAL(std::string("Zm9vbA=="), fz::base64_encode("fool")); CPPUNIT_ASSERT_EQUAL(std::string("Zm9vbHM="), fz::base64_encode("fools")); + CPPUNIT_ASSERT_EQUAL(std::string("Zg"), fz::base64_encode("f", fz::base64_type::standard, false)); + CPPUNIT_ASSERT_EQUAL(std::string("Zm8"), fz::base64_encode("fo", fz::base64_type::standard, false)); + CPPUNIT_ASSERT_EQUAL(std::string("Zm9vbA"), fz::base64_encode("fool", fz::base64_type::standard, false)); + CPPUNIT_ASSERT_EQUAL(std::string("Zm9vbHM"), fz::base64_encode("fools", fz::base64_type::standard, false)); + CPPUNIT_ASSERT_EQUAL(std::string("AAECA/3+/w=="), fz::base64_encode({0, 1, 2, 3, '\xfd', '\xfe', '\xff'})); + CPPUNIT_ASSERT_EQUAL(std::string("AAECA_3-_w=="), fz::base64_encode({0, 1, 2, 3, '\xfd', '\xfe', '\xff'}, fz::base64_type::url)); + // decode CPPUNIT_ASSERT_EQUAL(std::string(""), fz::base64_decode("")); CPPUNIT_ASSERT_EQUAL(std::string("f"), fz::base64_decode("Zg==")); @@ -102,7 +109,13 @@ CPPUNIT_ASSERT_EQUAL(std::string("fool"), fz::base64_decode("Zm9vbA==")); CPPUNIT_ASSERT_EQUAL(std::string("fools"), fz::base64_decode("Zm9vbHM=")); + CPPUNIT_ASSERT_EQUAL(std::string("f"), fz::base64_decode("Zg")); + CPPUNIT_ASSERT_EQUAL(std::string("fo"), fz::base64_decode("Zm8")); + CPPUNIT_ASSERT_EQUAL(std::string("fool"), fz::base64_decode("Zm9vbA")); + CPPUNIT_ASSERT_EQUAL(std::string("fools"), fz::base64_decode("Zm9vbHM")); + CPPUNIT_ASSERT_EQUAL(std::string({0, 1, 2, 3, '\xfd', '\xfe', '\xff'}), fz::base64_decode("AAECA/3+/w==")); + CPPUNIT_ASSERT_EQUAL(std::string({0, 1, 2, 3, '\xfd', '\xfe', '\xff'}), fz::base64_decode("AAECA_3-_w")); // with whitespace CPPUNIT_ASSERT_EQUAL(std::string("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."),
