Gracefully handle leading 'boot/' in command line conditions

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2023-02-17 13:14:42 +01:00
1 parent 4d2b97e4cc
commit 4150fdfe59
1 file changed
+4 -1
+4 -1
View File
@@ -85,7 +85,10 @@ static void cond_boot_strap(void)
while (ptr) {
char cond[strlen(ptr) + 6];
snprintf(cond, sizeof(cond), "boot/%s", ptr);
if (strncmp(ptr, "boot/", 5))
snprintf(cond, sizeof(cond), "boot/%s", ptr);
else
snprintf(cond, sizeof(cond), "%s", ptr);
cond_set_oneshot_noupdate(cond);
ptr = strtok(NULL, ",");