]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-settings: Move path_element_count() earlier
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 16 Nov 2023 20:38:39 +0000 (22:38 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 17 Jan 2025 08:39:57 +0000 (10:39 +0200)
src/lib-settings/settings.c

index 06441538461af3a23c66c105df0a7aec898da4c5..f29cf6b8df15cd28e556fde6e322dffc82f0b692 100644 (file)
@@ -152,6 +152,16 @@ settings_instance_override(struct settings_apply_ctx *ctx,
                           struct event_filter *event_filter,
                           const char **error_r);
 
+static unsigned int path_element_count(const char *key)
+{
+       unsigned int count = 1;
+       while ((key = strchr(key, '/')) != NULL) {
+               key++;
+               count++;
+       }
+       return count;
+}
+
 static int
 settings_block_read_uint32(struct settings_mmap *mmap,
                           size_t *offset, size_t end_offset,
@@ -1720,16 +1730,6 @@ settings_get_or_fatal(struct event *event,
        return set;
 }
 
-static unsigned int path_element_count(const char *key)
-{
-       unsigned int count = 1;
-       while ((key = strchr(key, '/')) != NULL) {
-               key++;
-               count++;
-       }
-       return count;
-}
-
 void settings_override(struct settings_instance *instance,
                       const char *key, const char *value,
                       enum settings_override_type type)