refactor(module): centralize path parsing and add OS-specific separator
- Define STK_PATH_SEP macro to handle Windows and Unix path separators. - Refactor extract_module_id to use STK_PATH_SEP. - Simplify stk_module_load by delegating module ID extraction to extract_module_id.
This commit is contained in:
@@ -142,7 +142,6 @@ size_t stk_poll(void)
|
||||
for (i = 0; i < file_count; ++i) {
|
||||
extract_module_id(file_list[i], mod_id);
|
||||
switch (events[i]) {
|
||||
|
||||
case STK_MOD_LOAD:
|
||||
loaded_mod_indices[load_index++] = i;
|
||||
break;
|
||||
@@ -240,6 +239,7 @@ trim_arrays:
|
||||
++write_pos;
|
||||
}
|
||||
}
|
||||
|
||||
module_count = write_pos;
|
||||
stk_module_realloc_memory(module_count);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user