Better fix for #16281 (#16460)

This commit is contained in:
pancake 2020-04-07 23:47:11 +02:00 committed by GitHub
parent 6f03942d8f
commit 4e08d7b01e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -42,8 +42,13 @@ CB (bin, bin)
CB (egg, egg)
CB (fs, fs)
static void __openPluginsAt(RCore *core, const char *arg) {
static void __openPluginsAt(RCore *core, const char *arg, const char *user_path) {
if (arg && *arg) {
if (user_path) {
if (r_str_endswith (user_path, arg)) {
return;
}
}
char *pdir = r_str_r2_prefix (arg);
if (pdir) {
r_lib_opendir (core->lib, pdir);
@ -79,11 +84,9 @@ static void __loadSystemPlugins(RCore *core, int where, const char *path) {
}
}
if (where & R_CORE_LOADLIBS_SYSTEM) {
if (strstr (R2_PLUGINS, dir_plugins)) {
__openPluginsAt (core, R2_PLUGINS);
}
__openPluginsAt (core, R2_EXTRAS);
__openPluginsAt (core, R2_BINDINGS);
__openPluginsAt (core, R2_PLUGINS, dir_plugins);
__openPluginsAt (core, R2_EXTRAS, dir_plugins);
__openPluginsAt (core, R2_BINDINGS, dir_plugins);
}
#endif
}