Refactor the ROM set command line options

This commit is contained in:
David Hrdlička
2022-04-08 01:33:49 +02:00
parent 3449a173ae
commit db2b868909
2 changed files with 38 additions and 54 deletions

View File

@@ -62,14 +62,18 @@ rom_add_path(const char* path)
{
char cwd[1024] = { 0 };
// Iterate to the end of the list.
rom_path_t* rom_path = &rom_paths;
while (rom_path->next != NULL) {
rom_path = rom_path->next;
}
// Allocate the new entry.
rom_path = rom_path->next = calloc(1, sizeof(rom_path_t));
if (rom_paths.path[0] != '\0')
{
// Iterate to the end of the list.
while (rom_path->next != NULL) {
rom_path = rom_path->next;
}
// Allocate the new entry.
rom_path = rom_path->next = calloc(1, sizeof(rom_path_t));
}
// Save the path, turning it into absolute if needed.
if (!plat_path_abs((char*) path)) {