:: commit 8e97650ae99045ec66d9939198557315cca22037

mintsuki <mintsuki@protonmail.com> — 2023-03-30 00:43

parents: 425a2328f0

limine: Fix issue with internal modules and kernels in root dir

diff --git a/common/protos/limine.c b/common/protos/limine.c
index 773ac88e..96558245 100644
--- a/common/protos/limine.c
+++ b/common/protos/limine.c
@@ -320,7 +320,7 @@ noreturn void limine_load(char *config, char *cmdline) {
     strcpy(k_path_ + 1, k_path);
     k_path = k_path_;
     for (size_t i = strlen(k_path) - 1; ; i--) {
-        if (k_path[i] == '/') {
+        if (k_path[i] == '/' || i == 1) {
             k_path[i] = 0;
             break;
         }
diff --git a/test/limine.c b/test/limine.c
index dbcd60b3..05ac5f55 100644
--- a/test/limine.c
+++ b/test/limine.c
@@ -65,16 +65,22 @@ struct limine_internal_module internal_module2 = {
     .cmdline = "Second internal module"
 };
 
+struct limine_internal_module internal_module3 = {
+    .path = "./limine.cfg",
+    .cmdline = "Second internal module"
+};
+
 struct limine_internal_module *internal_modules[] = {
     &internal_module1,
-    &internal_module2
+    &internal_module2,
+    &internal_module3
 };
 
 struct limine_module_request module_request = {
     .id = LIMINE_MODULE_REQUEST,
     .revision = 1, .response = NULL,
 
-    .internal_module_count = 2,
+    .internal_module_count = 3,
     .internal_modules = internal_modules
 };
 
tab: 248 wrap: offon