Date: Fri, 28 Aug 2020 22:16:13 +0000 (UTC) From: Adriaan de Groot <adridg@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r546841 - in head/sysutils/zbackup: . files Message-ID: <202008282216.07SMGDSw076694@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: adridg Date: Fri Aug 28 22:16:13 2020 New Revision: 546841 URL: https://svnweb.freebsd.org/changeset/ports/546841 Log: Fix sysutils/zbackup in the face of modern C++ The "smart" pointer has had a serious bug for years, but the method with the bug isn't used :S Fix the bug, throw in some gratuitous C++ modernizations while we're at it. Patches submitted upstream. Added: head/sysutils/zbackup/files/patch-sptr.hh (contents, props changed) Modified: head/sysutils/zbackup/Makefile Modified: head/sysutils/zbackup/Makefile ============================================================================== --- head/sysutils/zbackup/Makefile Fri Aug 28 22:11:24 2020 (r546840) +++ head/sysutils/zbackup/Makefile Fri Aug 28 22:16:13 2020 (r546841) @@ -2,7 +2,7 @@ PORTNAME= zbackup PORTVERSION= 1.4.4 -PORTREVISION= 15 +PORTREVISION= 16 CATEGORIES= sysutils MAINTAINER= ports@FreeBSD.org Added: head/sysutils/zbackup/files/patch-sptr.hh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/zbackup/files/patch-sptr.hh Fri Aug 28 22:16:13 2020 (r546841) @@ -0,0 +1,47 @@ +--- sptr.hh.orig 2015-09-16 07:28:04 UTC ++++ sptr.hh +@@ -25,9 +25,9 @@ class sptr_base + + public: + +- sptr_base(): p( 0 ), count( 0 ) {} ++ sptr_base(): p( nullptr ), count( nullptr ) {} + +- sptr_base( T * p_ ): p( p_ ), count( p ? new unsigned( 1 ) : 0 ) ++ sptr_base( T * p_ ): p( p_ ), count( p ? new unsigned( 1 ) : nullptr ) + { + } + +@@ -48,27 +48,27 @@ class sptr_base + { + delete count; + +- count = 0; ++ count = nullptr; + + if ( p ) + { + T * p_ = p; + +- p = 0; ++ p = nullptr; + + delete p_; + } + } + else + { +- p = 0; +- count = 0; ++ p = nullptr; ++ count = nullptr; + } + } + } + + unsigned use_count() const +- { return count; } ++ { return *count; } + + sptr_base & operator = ( sptr_base const & other ) + { if ( &other != this ) { reset(); p = other.p; count = other.count; increment(); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202008282216.07SMGDSw076694>