]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/basic/conf-files.c
strv: make iterator in STRV_FOREACH() declaread in the loop
[thirdparty/systemd.git] / src / basic / conf-files.c
index 9f0c97b691ae6c2888bda19199557ec4d9637d38..82c6dc5677b132350b8cbb54c1458707b8717f67 100644 (file)
@@ -30,7 +30,6 @@ static int files_add(
 
         _cleanup_closedir_ DIR *dir = NULL;
         const char *dirpath;
-        struct dirent *de;
         int r;
 
         assert(h);
@@ -146,7 +145,7 @@ static int conf_files_list_strv_internal(
 
         _cleanup_hashmap_free_ Hashmap *fh = NULL;
         _cleanup_set_free_free_ Set *masked = NULL;
-        char **files, **p;
+        char **files;
         int r;
 
         assert(ret);
@@ -203,11 +202,8 @@ int conf_files_insert(char ***strv, const char *root, char **dirs, const char *p
                 int c;
 
                 c = base_cmp((char* const*) *strv + i, (char* const*) &path);
-                if (c == 0) {
-                        char **dir;
-
+                if (c == 0)
                         /* Oh, there already is an entry with a matching name (the last component). */
-
                         STRV_FOREACH(dir, dirs) {
                                 _cleanup_free_ char *rdir = NULL;
                                 char *p1, *p2;
@@ -234,7 +230,7 @@ int conf_files_insert(char ***strv, const char *root, char **dirs, const char *p
                                 }
                         }
 
-                else if (c > 0)
+                else if (c > 0)
                         /* Following files have lower priority, let's go insert our
                          * new entry. */
                         break;