gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] branch master updated: skip inaccessible sections when iteratin


From: gnunet
Subject: [gnunet] branch master updated: skip inaccessible sections when iterating
Date: Sun, 22 Dec 2024 21:26:47 +0100

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

grothoff pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 269366637 skip inaccessible sections when iterating
269366637 is described below

commit 2693666370956f84eb6cde80d47230859fbfa60b
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sun Dec 22 21:26:40 2024 +0100

    skip inaccessible sections when iterating
---
 src/lib/util/configuration.c | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/src/lib/util/configuration.c b/src/lib/util/configuration.c
index 9bca4ac5f..3759af86f 100644
--- a/src/lib/util/configuration.c
+++ b/src/lib/util/configuration.c
@@ -681,7 +681,7 @@ find_entry (const struct GNUNET_CONFIGURATION_Handle *cfg,
   {
     LOG (GNUNET_ERROR_TYPE_WARNING,
          "Section '%s' is marked as inaccessible, because the configuration "
-         " file that contains the section can't be read.  Attempts to use "
+         "file that contains the section can't be read.  Attempts to use "
          "option '%s' will fail.\n",
          section,
          key);
@@ -1514,7 +1514,6 @@ GNUNET_CONFIGURATION_iterate_section_values (
   void *iter_cls)
 {
   struct ConfigSection *spos;
-  struct ConfigEntry *epos;
 
   spos = cfg->sections;
   while ((spos != NULL) && (0 != strcasecmp (spos->name, section)))
@@ -1525,13 +1524,18 @@ GNUNET_CONFIGURATION_iterate_section_values (
   {
     LOG (GNUNET_ERROR_TYPE_WARNING,
          "Section '%s' is marked as inaccessible, because the configuration "
-         " file that contains the section can't be read.\n",
+         "file that contains the section can't be read.\n",
          section);
     return;
   }
-  for (epos = spos->entries; NULL != epos; epos = epos->next)
+  for (struct ConfigEntry *epos = spos->entries;
+       NULL != epos;
+       epos = epos->next)
     if (NULL != epos->val)
-      iter (iter_cls, spos->name, epos->key, epos->val);
+      iter (iter_cls,
+            spos->name,
+            epos->key,
+            epos->val);
 }
 
 
@@ -1549,7 +1553,9 @@ GNUNET_CONFIGURATION_iterate_sections (
   {
     spos = next;
     next = spos->next;
-    iter (iter_cls, spos->name);
+    if (! spos->inaccessible)
+      iter (iter_cls,
+            spos->name);
   }
 }
 
@@ -1566,7 +1572,8 @@ GNUNET_CONFIGURATION_remove_section (struct 
GNUNET_CONFIGURATION_Handle *cfg,
   spos = cfg->sections;
   while (NULL != spos)
   {
-    if (0 == strcasecmp (section, spos->name))
+    if (0 == strcasecmp (section,
+                         spos->name))
     {
       if (NULL == prev)
         cfg->sections = spos->next;

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]