This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=7fd5d9c99f50cb9eec402aeff5870ad63193db73

commit 7fd5d9c99f50cb9eec402aeff5870ad63193db73
Author: Guillem Jover <[email protected]>
AuthorDate: Tue Jul 23 02:34:29 2024 +0200

    libdpkg: Add new varbuf C++ constructor initialized from a C string
    
    This will make it more ergonomic to declare varbufs in C++ code.
---
 lib/dpkg/varbuf.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lib/dpkg/varbuf.h b/lib/dpkg/varbuf.h
index b6af656da..e27f0d19e 100644
--- a/lib/dpkg/varbuf.h
+++ b/lib/dpkg/varbuf.h
@@ -59,6 +59,7 @@ struct varbuf {
 
 #ifdef __cplusplus
        explicit varbuf(size_t _size = 0);
+       explicit varbuf(const char *str);
        ~varbuf();
 
        void init(size_t _size = 0);
@@ -178,6 +179,13 @@ varbuf::varbuf(size_t _size)
        varbuf_init(this, _size);
 }
 
+inline
+varbuf::varbuf(const char *str)
+{
+       varbuf_init(this, 0);
+       varbuf_set_str(this, str);
+}
+
 inline
 varbuf::~varbuf()
 {

-- 
Dpkg.Org's dpkg

Reply via email to