:: commit 8cecd79ddbaae4f32cc1ae51e79b035e4aa18683

mintsuki <mintsuki@protonmail.com> — 2024-08-02 04:18

parents: 0357fdb4d8

lib/config: Ignore spaces at beginning of entry name

diff --git a/common/lib/config.c b/common/lib/config.c
index 15ff5e51..66d5112e 100644
--- a/common/lib/config.c
+++ b/common/lib/config.c
@@ -108,7 +108,12 @@ static struct menu_entry *create_menu_tree(struct menu_entry *parent,
 
         bool default_expanded = name[current_depth] == '+';
 
-        strcpy(entry->name, name + current_depth + default_expanded);
+        char *n = &name[current_depth + default_expanded];
+        while (*n == ' ') {
+            n++;
+        }
+
+        strcpy(entry->name, n);
         entry->parent = parent;
 
         size_t entry_size;
tab: 248 wrap: offon