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=f724d507677674d4386816098bf038aa1567c081

commit f724d507677674d4386816098bf038aa1567c081
Author: Guillem Jover <[email protected]>
AuthorDate: Wed Jul 10 06:25:24 2024 +0200

    Revert "dpkg-realpath: Switch direct varbuf accesses to varbuf_str()"
    
    This reverts commit 0fee7b211d8f31067bb444268860d995a8c1ba1e.
    
    This was making cppcheck hit a bogus syntax error, and making the
    authorcheck fail. We'll workaround the issue by using an alternative
    method to make the code more robust.
    
    Ref: https://bugs.debian.org/1076061
    Changelog: internal
---
 src/realpath/main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/realpath/main.c b/src/realpath/main.c
index 5d41adf6c..b4a2d1d21 100644
--- a/src/realpath/main.c
+++ b/src/realpath/main.c
@@ -99,7 +99,7 @@ realpath_relative_to(const char *pathname, const char 
*rootdir)
        varbuf_set_str(&result, rootdir);
 
        /* Check whether the path is relative, make it absolute otherwise. */
-       if (varbuf_str(&src)[0] != '/') {
+       if (src.buf[0] != '/') {
                struct varbuf abs_src = VARBUF_INIT;
 
                file_getcwd(&abs_src);
@@ -139,7 +139,7 @@ realpath_relative_to(const char *pathname, const char 
*rootdir)
                        /* Ignore, stay at the same directory. */
                } else if (strcmp(prefix.buf, "..") == 0) {
                        /* Go up one directory. */
-                       slash = strrchr(varbuf_str(&result), '/');
+                       slash = strrchr(result.buf, '/');
                        if (slash != NULL)
                                varbuf_trunc(&result, slash - result.buf);
 
@@ -160,7 +160,7 @@ realpath_relative_to(const char *pathname, const char 
*rootdir)
                                ohshit(_("symbolic link '%s' size has changed 
from %jd to %zd"),
                                       slink.buf, (intmax_t)st.st_size, 
linksize);
 
-                       if (varbuf_str(&dst)[0] == '/') {
+                       if (dst.buf[0] == '/') {
                                /* Absolute pathname, reset result back to
                                 * root. */
                                varbuf_set_varbuf(&result, &root);

-- 
Dpkg.Org's dpkg

Reply via email to