diff options
Diffstat (limited to 'platform/android/os_android.cpp')
-rw-r--r-- | platform/android/os_android.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp index 4469c7a0f7..97fa90b1d2 100644 --- a/platform/android/os_android.cpp +++ b/platform/android/os_android.cpp @@ -162,11 +162,16 @@ Vector<String> OS_Android::get_granted_permissions() const { } Error OS_Android::open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path, String *r_resolved_path) { - p_library_handle = dlopen(p_path.utf8().get_data(), RTLD_NOW); + String path = p_path; + if (!FileAccess::exists(path)) { + path = p_path.get_file(); + } + + p_library_handle = dlopen(path.utf8().get_data(), RTLD_NOW); ERR_FAIL_NULL_V_MSG(p_library_handle, ERR_CANT_OPEN, "Can't open dynamic library: " + p_path + ", error: " + dlerror() + "."); if (r_resolved_path != nullptr) { - *r_resolved_path = p_path; + *r_resolved_path = path; } return OK; |