From 11496654027d7e6d97ff60be2fb9c073d510a678 Mon Sep 17 00:00:00 2001 From: langerhans Date: Thu, 3 May 2018 21:45:40 +0200 Subject: [PATCH] stage2 loader: Fix loadlist parsing breaking out of the loop too early --- fusee/fusee-secondary/src/loader.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/fusee/fusee-secondary/src/loader.c b/fusee/fusee-secondary/src/loader.c index 0c72411e4..6c1f65716 100644 --- a/fusee/fusee-secondary/src/loader.c +++ b/fusee/fusee-secondary/src/loader.c @@ -110,20 +110,22 @@ void parse_loadlist(const char *ll) { /* Load the entry. */ load_list_entry(entry); /* Skip to the next delimiter. */ - for (; *p == ' ' || *p == '\t'; p++) { } - if (*p == '\x00') { - break; - } else if (*p != '|') { + for (; *p == ' ' || *p == '\t' || *p == '\x00'; p++) { } + if (*p != '|') { printk("Error: Load list is malformed!\n"); generic_panic(); } else { /* Skip to the next entry. */ - for (; *p == ' ' || *p == '\t'; p++) { } + for (; *p == ' ' || *p == '\t' || *p == '|'; p++) { } entry = p; } } - + p++; + if (*p == '\x00') { + /* We're at the end of the line, load the last entry */ + load_list_entry(entry); + } } }