Berry introspect.module() failed to load modules in files (#23376)

This commit is contained in:
s-hadinger 2025-05-05 22:33:52 +02:00 committed by GitHub
parent 2ab84dd3a4
commit f83b5a8c80
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 3 deletions

View File

@ -25,6 +25,7 @@ All notable changes to this project will be documented in this file.
- Berry `display.touch_update` wrongly applies resistive calibration (#23363)
- NimBLE log_level definition conflict (#23366)
- Matter and mDNS can be enabled at the same time (#23373)
- Berry `introspect.module()` failed to load modules in files
### Removed

View File

@ -132,10 +132,10 @@ static char* fixpath(bvm *vm, bstring *path, size_t *size)
if (var_isclosure(func)) {
base = str(cl->proto->source); /* get the source file path */
} else {
base = "/";
base = "";
}
#else
base = "/";
base = "";
#endif
split = be_splitpath(base);
*size = split - base + (size_t)str_len(path) + SUFFIX_LEN;
@ -183,11 +183,14 @@ static int open_libfile(bvm *vm, char *path, size_t size)
strcpy(path + size - SUFFIX_LEN, sfxs[idx]);
res = open_script(vm, path);
} while (idx++ < 2 && res == BE_IO_ERROR);
if (res == BE_IO_ERROR) {
#if BE_USE_SHARED_LIB
if (res == BE_IO_ERROR) {
strcpy(path + size - SUFFIX_LEN, DLL_SUFFIX);
res = open_dllib(vm, path);
}
#endif
if (res == BE_EXCEPTION) {
be_dumpexcept(vm);
}
be_free(vm, path, size);
return res;