:: commit ddd3f5161aff75c7f89796d760c71aa8b10e0265

mintsuki <mintsuki@protonmail.com> — 2024-08-01 04:44

parents: a014d0758c

config: Change syntax to allow any casing for option names

diff --git a/common/lib/config.c b/common/lib/config.c
index b59eb2cc..27a4fbc7 100644
--- a/common/lib/config.c
+++ b/common/lib/config.c
@@ -464,7 +464,7 @@ char *config_get_value(const char *config, size_t index, const char *key) {
     size_t key_len = strlen(key);
 
     for (size_t i = 0; config[i]; i++) {
-        if (!strncmp(&config[i], key, key_len) && config[i + key_len] == ':') {
+        if (!strncasecmp(&config[i], key, key_len) && config[i + key_len] == ':') {
             if (i && config[i - 1] != SEPARATOR)
                 continue;
             if (index--)
diff --git a/common/menu.c b/common/menu.c
index 4ded8efa..5b4bf775 100644
--- a/common/menu.c
+++ b/common/menu.c
@@ -139,7 +139,7 @@ fail:
 found_equals:
     if (i < 64) keybuf[i] = 0;
     for (i = 0; VALID_KEYS[i]; i++) {
-        if (!strcmp(keybuf, VALID_KEYS[i])) {
+        if (!strcasecmp(keybuf, VALID_KEYS[i])) {
             return TOK_KEY;
         }
     }
diff --git a/test/limine.cfg b/test/limine.cfg
index 3888aa8a..4a13bdfc 100644
--- a/test/limine.cfg
+++ b/test/limine.cfg
@@ -2,57 +2,57 @@
 ${TEST_KERNEL}=boot:///boot/test.elf
 ${WALLPAPER_PATH}=boot:///boot/bg.jpg
 
-DEFAULT_ENTRY: 1
-TIMEOUT: 3
-VERBOSE: yes
+default_entry: 1
+timeout: 3
+verbose: yes
 
 # Terminal related settings
-TERM_WALLPAPER: ${WALLPAPER_PATH}
-TERM_BACKDROP: 008080
+term_wallpaper: ${WALLPAPER_PATH}
+term_backdrop: 008080
 
 :Limine Test
-    COMMENT: Test of the Limine boot protocol. ${ARCH}
+    comment: Test of the Limine boot protocol. ${ARCH}
 
-    PROTOCOL: limine
-    KERNEL_PATH: ${TEST_KERNEL}
-    KERNEL_CMDLINE: This is an example kernel command line.
+    protocol: limine
+    kernel_path: ${TEST_KERNEL}
+    kernel_cmdline: This is an example kernel command line.
 
-    MODULE_PATH: ${WALLPAPER_PATH}
-    MODULE_CMDLINE: This is the first module.
+    module_path: ${WALLPAPER_PATH}
+    module_cmdline: This is the first module.
 
-    MODULE_PATH: boot:///boot/bg.jpg
+    module_path: boot:///boot/bg.jpg
 
 :Multiboot2 Test
-    COMMENT: Test of the multiboot2 boot protocol.
+    comment: Test of the multiboot2 boot protocol.
 
-    PROTOCOL: multiboot2
-    KERNEL_PATH: boot:///boot/multiboot2.elf
-    KERNEL_CMDLINE: This is an example kernel command line.
+    protocol: multiboot2
+    kernel_path: boot:///boot/multiboot2.elf
+    kernel_cmdline: This is an example kernel command line.
 
-    MODULE_PATH: boot:///boot/bg.jpg
-    MODULE_STRING: This is the first module.
+    module_path: boot:///boot/bg.jpg
+    module_string: This is the first module.
 
 :EFI Chainloading
-    COMMENT: Test EFI image chainloading.
+    comment: Test EFI image chainloading.
 
-    PROTOCOL: efi_chainload
-    IMAGE_PATH: boot:///EFI/BOOT/BOOTX64.EFI
+    protocol: efi_chainload
+    image_path: boot:///EFI/BOOT/BOOTX64.EFI
 
 :BIOS Chainloading
-    COMMENT: Test BIOS chainloading.
+    comment: Test BIOS chainloading.
 
-    PROTOCOL: bios_chainload
-    DRIVE: 1
+    protocol: bios_chainload
+    drive: 1
 
 :+Legacy
-    COMMENT: Directory containing legacy entries.
+    comment: Directory containing legacy entries.
 
     ::Multiboot1 Test
-        COMMENT: Test of the multiboot1 boot protocol.
+        comment: Test of the multiboot1 boot protocol.
 
-        PROTOCOL: multiboot1
-        KERNEL_PATH: boot:///boot/multiboot.elf
-        KERNEL_CMDLINE: This is an example kernel command line.
+        protocol: multiboot1
+        kernel_path: boot:///boot/multiboot.elf
+        kernel_cmdline: This is an example kernel command line.
 
-        MODULE_PATH: boot:///boot/bg.jpg
-        MODULE_STRING: This is the first module.
+        module_path: boot:///boot/bg.jpg
+        module_string: This is the first module.
tab: 248 wrap: offon