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

commit e1b614edd6ed1f7bf886bb354f4ae47810a39686
Author: Guillem Jover <[email protected]>
AuthorDate: Sat Nov 26 01:32:24 2022 +0100

    libdpkg: Remove unneeded intermediate variable in dpkg_fsys_set_dir()
    
    When dir is already NULL, there is no point in protecting any assignment
    from getenv() as we are not stomping over any possible pre-existing
    value anyway. Remove the intermediate env variable.
---
 lib/dpkg/fsys-dir.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/lib/dpkg/fsys-dir.c b/lib/dpkg/fsys-dir.c
index 7e779d667..016b265e1 100644
--- a/lib/dpkg/fsys-dir.c
+++ b/lib/dpkg/fsys-dir.c
@@ -48,13 +48,8 @@ dpkg_fsys_set_dir(const char *dir)
 {
        char *fsys_dir_new;
 
-       if (dir == NULL) {
-               const char *env;
-
-               env = getenv("DPKG_ROOT");
-               if (env)
-                       dir = env;
-       }
+       if (dir == NULL)
+               dir = getenv("DPKG_ROOT");
 
        if (dir == NULL) {
                fsys_dir = "";

-- 
Dpkg.Org's dpkg

Reply via email to