Hello community,
here is the log from the commit of package libfilezilla for openSUSE:Factory checked in at 2016-04-28 16:57:21
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libfilezilla (Old)
and /work/SRC/openSUSE:Factory/.libfilezilla.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libfilezilla"
Changes:
--------
--- /work/SRC/openSUSE:Factory/libfilezilla/libfilezilla.changes 2016-03-26 15:22:47.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.libfilezilla.new/libfilezilla.changes 2016-04-28 17:02:36.000000000 +0200
@@ -1,0 +2,11 @@
+Wed Apr 27 11:53:21 UTC 2016 - joerg.lorenzen@ki.tng.de
+
+- Update to version 0.5.0
+ - Handle timestamps where midnight is represented as 24:00:00.000
+ of the previous day.
+ - Fix inverted return value of fz::datetime::empty().
+ - Increase performance of event loop if not using timers.
+ - Better compatibility with runtimes that change the src pointer
+ passed to mbsrtowcs or wcsrtombs.
+
+-------------------------------------------------------------------
Old:
----
libfilezilla-0.4.0.1.tar.bz2
New:
----
libfilezilla-0.5.0.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libfilezilla.spec ++++++
--- /var/tmp/diff_new_pack.pBIVko/_old 2016-04-28 17:02:38.000000000 +0200
+++ /var/tmp/diff_new_pack.pBIVko/_new 2016-04-28 17:02:38.000000000 +0200
@@ -20,7 +20,7 @@
%define libname %{name}%{major}
%define develname %{name}-devel
Name: libfilezilla
-Version: 0.4.0.1
+Version: 0.5.0
Release: 0
Summary: C++ library for filezilla
License: GPL-2.0+
++++++ libfilezilla-0.4.0.1.tar.bz2 -> libfilezilla-0.5.0.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.4.0.1/NEWS new/libfilezilla-0.5.0/NEWS
--- old/libfilezilla-0.4.0.1/NEWS 2016-02-22 14:42:19.000000000 +0100
+++ new/libfilezilla-0.5.0/NEWS 2016-04-15 09:52:25.000000000 +0200
@@ -1,3 +1,10 @@
+0.5.0 (2016-04-15)
+
+- Handle timestamps where midnight is represented as 24:00:00.000 of the previous day
+- Fix inverted return value of fz::datetime::empty()
+- Increase performance of event loop if not using timers
+- Better compatibility with runtimes that change the src pointer passed to mbsrtowcs or wcsrtombs
+
0.4.0.1 (2016-02-22)
- Fix compile error in testcase
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.4.0.1/configure new/libfilezilla-0.5.0/configure
--- old/libfilezilla-0.4.0.1/configure 2016-02-22 14:42:38.000000000 +0100
+++ new/libfilezilla-0.5.0/configure 2016-04-15 09:52:38.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.4.0.1.
+# Generated by GNU Autoconf 2.69 for libfilezilla 0.5.0.
#
# Report bugs to .
#
@@ -590,8 +590,8 @@
# Identity of this package.
PACKAGE_NAME='libfilezilla'
PACKAGE_TARNAME='libfilezilla'
-PACKAGE_VERSION='0.4.0.1'
-PACKAGE_STRING='libfilezilla 0.4.0.1'
+PACKAGE_VERSION='0.5.0'
+PACKAGE_STRING='libfilezilla 0.5.0'
PACKAGE_BUGREPORT='tim.kosse@filezilla-project.org'
PACKAGE_URL='https://lib.filezilla-project.org/'
@@ -1395,7 +1395,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.4.0.1 to adapt to many kinds of systems.
+\`configure' configures libfilezilla 0.5.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1465,7 +1465,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of libfilezilla 0.4.0.1:";;
+ short | recursive ) echo "Configuration of libfilezilla 0.5.0:";;
esac
cat <<\_ACEOF
@@ -1589,7 +1589,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-libfilezilla configure 0.4.0.1
+libfilezilla configure 0.5.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2034,7 +2034,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.4.0.1, which was
+It was created by libfilezilla $as_me 0.5.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2900,7 +2900,7 @@
# Define the identity of the package.
PACKAGE='libfilezilla'
- VERSION='0.4.0.1'
+ VERSION='0.5.0'
cat >>confdefs.h <<_ACEOF
@@ -19461,7 +19461,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.4.0.1, which was
+This file was extended by libfilezilla $as_me 0.5.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -19528,7 +19528,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.4.0.1
+libfilezilla config.status 0.5.0
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.4.0.1/configure.ac new/libfilezilla-0.5.0/configure.ac
--- old/libfilezilla-0.4.0.1/configure.ac 2016-02-22 14:42:26.000000000 +0100
+++ new/libfilezilla-0.5.0/configure.ac 2016-04-15 09:52:27.000000000 +0200
@@ -1,4 +1,4 @@
-AC_INIT([libfilezilla],[0.4.0.1],[tim.kosse@filezilla-project.org],[],[https://lib.filezilla-project.org/])
+AC_INIT([libfilezilla],[0.5.0],[tim.kosse@filezilla-project.org],[],[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.4.0.1/demos/list.cpp new/libfilezilla-0.5.0/demos/list.cpp
--- old/libfilezilla-0.4.0.1/demos/list.cpp 2016-01-31 11:35:01.000000000 +0100
+++ new/libfilezilla-0.5.0/demos/list.cpp 2016-04-15 09:52:15.000000000 +0200
@@ -19,8 +19,7 @@
return 1;
}
- std::cout << "Listing " << fz::to_string(path) << "\n\n";
- std::cout << "Name Link? Type Size Modified Mode\n";
+ std::cout << "Listing " << fz::to_string(path) << "\n";
std::cout << "----------------------------------\n";
fz::native_string name;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.4.0.1/lib/event_loop.cpp new/libfilezilla-0.5.0/lib/event_loop.cpp
--- old/libfilezilla-0.4.0.1/lib/event_loop.cpp 2016-01-31 11:35:01.000000000 +0100
+++ new/libfilezilla-0.5.0/lib/event_loop.cpp 2016-04-15 09:52:15.000000000 +0200
@@ -164,9 +164,10 @@
void event_loop::entry()
{
+ monotonic_clock now;
+
scoped_lock l(sync_);
while (!quit_) {
- monotonic_clock const now(monotonic_clock::now());
if (process_timers(l, now)) {
continue;
}
@@ -184,10 +185,16 @@
}
}
-bool event_loop::process_timers(scoped_lock & l, monotonic_clock const& now)
+bool event_loop::process_timers(scoped_lock & l, monotonic_clock & now)
{
- if (!deadline_ || now < deadline_) {
- // There's no deadline or deadline has not yet expired
+ if (!deadline_) {
+ // There's no deadline
+ return false;
+ }
+
+ now = monotonic_clock::now();
+ if (now < deadline_) {
+ // Deadline has not yet expired
return false;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.4.0.1/lib/iputils.cpp new/libfilezilla-0.5.0/lib/iputils.cpp
--- old/libfilezilla-0.4.0.1/lib/iputils.cpp 2016-01-31 11:35:01.000000000 +0100
+++ new/libfilezilla-0.5.0/lib/iputils.cpp 2016-04-15 09:52:15.000000000 +0200
@@ -1,5 +1,7 @@
#include "libfilezilla/iputils.hpp"
+#include
+
namespace fz {
template
String do_get_ipv6_long_form(String short_address)
@@ -24,13 +26,13 @@
Char* out = buffer;
- const unsigned int len = short_address.size();
+ const size_t len = short_address.size();
if (len > 39)
return String();
// First part, before possible ::
- unsigned int i = 0;
- unsigned int grouplength = 0;
+ size_t i = 0;
+ size_t grouplength = 0;
Char const* s = short_address.c_str();
for (i = 0; i < len + 1; ++i) {
@@ -46,7 +48,7 @@
}
out += 4 - grouplength;
- for (unsigned int j = grouplength; j > 0; --j) {
+ for (size_t j = grouplength; j > 0; --j) {
*out++ = s[i - j];
}
// End of string...
@@ -89,7 +91,7 @@
Char* end_first = out;
out = &buffer[38];
- unsigned int stop = i;
+ size_t stop = i;
for (i = len - 1; i > stop; --i) {
if (out < end_first) {
// Too long
@@ -127,7 +129,7 @@
out -= 5 - grouplength;
out += 2;
- int diff = out - end_first;
+ ptrdiff_t diff = out - end_first;
if (diff < 0 || diff % 5) {
return String();
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.4.0.1/lib/libfilezilla/event_loop.hpp new/libfilezilla-0.5.0/lib/libfilezilla/event_loop.hpp
--- old/libfilezilla-0.4.0.1/lib/libfilezilla/event_loop.hpp 2015-11-02 14:47:31.000000000 +0100
+++ new/libfilezilla-0.5.0/lib/libfilezilla/event_loop.hpp 2016-04-15 09:52:15.000000000 +0200
@@ -74,7 +74,7 @@
bool FZ_PRIVATE_SYMBOL process_event(scoped_lock & l);
// Process timers. Returns true if a timer has been triggered
- bool FZ_PRIVATE_SYMBOL process_timers(scoped_lock & l, monotonic_clock const& now);
+ bool FZ_PRIVATE_SYMBOL process_timers(scoped_lock & l, monotonic_clock& now);
virtual void FZ_PRIVATE_SYMBOL entry();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.4.0.1/lib/libfilezilla/version.hpp new/libfilezilla-0.5.0/lib/libfilezilla/version.hpp
--- old/libfilezilla-0.4.0.1/lib/libfilezilla/version.hpp 2016-02-22 14:42:40.000000000 +0100
+++ new/libfilezilla-0.5.0/lib/libfilezilla/version.hpp 2016-04-15 09:52:56.000000000 +0200
@@ -9,15 +9,15 @@
#include <tuple>
/// \brief Version string of the libfilezilla headers
-#define LIBFILEZILLA_VERSION "0.4.0.1"
+#define LIBFILEZILLA_VERSION "0.5.0"
#define LIBFILEZILLA_VERSION_MAJOR 0
-#define LIBFILEZILLA_VERSION_MINOR 4
+#define LIBFILEZILLA_VERSION_MINOR 5
#define LIBFILEZILLA_VERSION_MICRO 0
-#define LIBFILEZILLA_VERSION_NANO 1
+#define LIBFILEZILLA_VERSION_NANO 0
/// \brief Suffix string, e.g. "rc1"
-#define LIBFILEZILLA_VERSION_SUFFIX "0.4.0.1"
+#define LIBFILEZILLA_VERSION_SUFFIX "0.5.0"
namespace fz {
/// \brief Get version string of libfilezilla
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.4.0.1/lib/local_filesys.cpp new/libfilezilla-0.5.0/lib/local_filesys.cpp
--- old/libfilezilla-0.4.0.1/lib/local_filesys.cpp 2015-11-19 14:20:07.000000000 +0100
+++ new/libfilezilla-0.5.0/lib/local_filesys.cpp 2016-04-15 09:52:15.000000000 +0200
@@ -162,7 +162,7 @@
if (modification_time) {
*modification_time = datetime(attributes.ftLastWriteTime, datetime::milliseconds);
- if (!modification_time->empty()) {
+ if (modification_time->empty()) {
*modification_time = datetime(attributes.ftCreationTime, datetime::milliseconds);
}
}
@@ -399,7 +399,7 @@
if (modification_time) {
*modification_time = datetime(info.ftLastWriteTime, datetime::milliseconds);
- if (!modification_time->empty()) {
+ if (modification_time->empty()) {
*modification_time = datetime(info.ftCreationTime, datetime::milliseconds);
}
}
@@ -436,7 +436,7 @@
else {
if (modification_time) {
*modification_time = datetime(m_find_data.ftLastWriteTime, datetime::milliseconds);
- if (!modification_time->empty()) {
+ if (modification_time->empty()) {
*modification_time = datetime(m_find_data.ftLastWriteTime, datetime::milliseconds);
}
}
@@ -550,7 +550,7 @@
bool local_filesys::set_modification_time(native_string const& path, datetime const& t)
{
- if (!t.empty())
+ if (t.empty())
return false;
#ifdef FZ_WINDOWS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.4.0.1/lib/string.cpp new/libfilezilla-0.5.0/lib/string.cpp
--- old/libfilezilla-0.4.0.1/lib/string.cpp 2015-11-19 14:20:07.000000000 +0100
+++ new/libfilezilla-0.5.0/lib/string.cpp 2016-04-15 09:52:15.000000000 +0200
@@ -81,7 +81,8 @@
ret.resize(len);
wchar_t* out_p = &ret[0];
- std::mbsrtowcs(out_p, &in_p, len + 1, &ps);
+ in_p = in.c_str(); // Some implementations of mbsrtowcs change src even on null dst
+ len = std::mbsrtowcs(out_p, &in_p, len + 1, &ps);
}
return ret;
@@ -139,6 +140,7 @@
ret.resize(len);
char* out_p = &ret[0];
+ in_p = in.c_str(); // Some implementations of wcsrtombs change src even on null dst
std::wcsrtombs(out_p, &in_p, len + 1, &ps);
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.4.0.1/lib/time.cpp new/libfilezilla-0.5.0/lib/time.cpp
--- old/libfilezilla-0.4.0.1/lib/time.cpp 2015-11-02 14:47:31.000000000 +0100
+++ new/libfilezilla-0.5.0/lib/time.cpp 2016-04-15 09:52:15.000000000 +0200
@@ -321,7 +321,7 @@
datetime& datetime::operator+=(duration const& op)
{
- if (empty()) {
+ if (!empty()) {
if (a_ < hours) {
t_ += op.get_days() * 24 * 3600 * 1000;
}
@@ -420,12 +420,11 @@
#ifdef FZ_WINDOWS
-bool datetime::set(SYSTEMTIME const& st, accuracy a, zone z)
+namespace {
+bool do_set(datetime & dt, SYSTEMTIME const& st, datetime::accuracy a, datetime::zone z)
{
- clear();
-
FILETIME ft{};
- if (a >= hours && z == local) {
+ if (a >= datetime::hours && z == datetime::local) {
SYSTEMTIME st2{};
if (!TzSpecificLocalTimeToSystemTime(0, &st, &st2)) {
return false;
@@ -437,7 +436,30 @@
else if (!SystemTimeToFileTime(&st, &ft)) {
return false;
}
- return set(ft, a);
+ return dt.set(ft, a);
+}
+}
+
+bool datetime::set(SYSTEMTIME const& st, accuracy a, zone z)
+{
+ clear();
+
+ bool success = do_set(*this, st, a, z);
+ if (!success) {
+ // Check for alternate midnight format
+ if (st.wHour == 24 && !st.wMinute && !st.wSecond && !st.wMilliseconds) {
+ SYSTEMTIME st2 = st;
+ st2.wHour = 23;
+ st2.wMinute = 59;
+ st2.wSecond = 59;
+ st2.wMilliseconds = 999;
+ success = do_set(*this, st2, a, z);
+ if (success) {
+ t_ += 1;
+ }
+ }
+ }
+ return success;
}
namespace {
@@ -503,7 +525,7 @@
bool datetime::imbue_time(int hour, int minute, int second, int millisecond)
{
- if (!empty() || a_ > days) {
+ if (empty() || a_ > days) {
return false;
}
@@ -521,7 +543,10 @@
}
if (hour < 0 || hour >= 24) {
- return false;
+ // Allow alternate midnight representation
+ if (hour != 24 || minute != 0 || second != 0 || millisecond != 0) {
+ return false;
+ }
}
if (minute < 0 || minute >= 60) {
return false;
@@ -539,7 +564,7 @@
bool datetime::empty() const
{
- return t_ != invalid;
+ return t_ == invalid;
}
void datetime::clear()
@@ -729,7 +754,7 @@
FILETIME datetime::get_filetime() const
{
FILETIME ret{};
- if (empty()) {
+ if (!empty()) {
int64_t t = t_;
t += EPOCH_OFFSET_IN_MSEC;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.4.0.1/tests/time.cpp new/libfilezilla-0.5.0/tests/time.cpp
--- old/libfilezilla-0.4.0.1/tests/time.cpp 2015-11-02 14:47:31.000000000 +0100
+++ new/libfilezilla-0.5.0/tests/time.cpp 2016-04-15 09:52:15.000000000 +0200
@@ -10,6 +10,7 @@
CPPUNIT_TEST_SUITE(TimeTest);
CPPUNIT_TEST(testNow);
CPPUNIT_TEST(testPreEpoch);
+ CPPUNIT_TEST(testAlternateMidnight);
CPPUNIT_TEST_SUITE_END();
public:
@@ -18,6 +19,8 @@
void testNow();
void testPreEpoch();
+
+ void testAlternateMidnight();
};
CPPUNIT_TEST_SUITE_REGISTRATION(TimeTest);
@@ -30,8 +33,8 @@
fz::datetime const t2 = fz::datetime::now();
- CPPUNIT_ASSERT(t1.empty());
- CPPUNIT_ASSERT(t2.empty());
+ CPPUNIT_ASSERT(!t1.empty());
+ CPPUNIT_ASSERT(!t2.empty());
CPPUNIT_ASSERT(t2 > t1);
auto const diff = t2 - t1;
@@ -48,7 +51,7 @@
fz::datetime const t1(fz::datetime::utc, 1957, 10, 4, 19, 28, 34);
- CPPUNIT_ASSERT(t1.empty());
+ CPPUNIT_ASSERT(!t1.empty());
CPPUNIT_ASSERT(t1 < now);
CPPUNIT_ASSERT(t1.get_time_t() < -1);
@@ -64,7 +67,7 @@
fz::datetime const t2(fz::datetime::utc, 1969, 12, 31, 23, 59, 59);
- CPPUNIT_ASSERT(t2.empty());
+ CPPUNIT_ASSERT(!t2.empty());
CPPUNIT_ASSERT(t2 > t1);
CPPUNIT_ASSERT(t2 < now);
@@ -76,3 +79,25 @@
CPPUNIT_ASSERT_EQUAL(59, tm2.tm_min);
CPPUNIT_ASSERT_EQUAL(59, tm2.tm_sec);
}
+
+void TimeTest::testAlternateMidnight()
+{
+ fz::datetime const t1(fz::datetime::utc, 2016, 4, 13, 0, 0, 0);
+ fz::datetime const t2(fz::datetime::utc, 2016, 4, 12, 24, 0, 0);
+ fz::datetime const t3("2016-04-13 00:00:00", fz::datetime::utc);
+ fz::datetime const t4("2016-04-12 24:00:00", fz::datetime::utc);
+
+ CPPUNIT_ASSERT(!t1.empty());
+ CPPUNIT_ASSERT(!t2.empty());
+ CPPUNIT_ASSERT(!t3.empty());
+ CPPUNIT_ASSERT(!t4.empty());
+
+ CPPUNIT_ASSERT(t1 == t2);
+ CPPUNIT_ASSERT(t1 == t3);
+ CPPUNIT_ASSERT(t1 == t4);
+
+ fz::datetime imbue("2016-04-12", fz::datetime::utc);
+ CPPUNIT_ASSERT(imbue.imbue_time(24, 0, 0));
+ CPPUNIT_ASSERT(t1 == imbue);
+
+}