Parser: Fix potential crash when failing to load certain files.
cmp_len shouldn't be set on registered files, because they don't have
a path. This was causing a failure on Linux because `import q` was
expanded to `./q.so` which has the same length as `random`.
@@ -650,7 +650,7 @@ void lily_register_package(lily_state *s, const char *name, const char **table,
(strlen(name) + 1) * sizeof(*module->loadname));
strcpy(module->loadname, name);
add_data_to_module(module, NULL, table, (lily_loader)loader);
- module->cmp_len = strlen(name);
+ module->cmp_len = 0;
module->flags |= MODULE_IS_REGISTERED;
}
