Fix libr plugins path

This commit is contained in:
pancake 2013-11-28 05:51:09 +01:00
parent da8c0a420b
commit 399a48da34
3 changed files with 8 additions and 4 deletions

View File

@ -158,6 +158,7 @@ static int __lib_asm_cb(struct r_lib_plugin_t *pl, void *user, void *data) {
static int __lib_asm_dt(struct r_lib_plugin_t *pl, void *p, void *u) { return R_TRUE; }
int main(int argc, char *argv[]) {
const char *path;
const char *env_arch = r_sys_getenv ("RASM2_ARCH");
const char *env_bits = r_sys_getenv ("RASM2_BITS");
char buf[R_ASM_BUFSIZE];
@ -170,7 +171,10 @@ int main(int argc, char *argv[]) {
l = r_lib_new ("radare_plugin");
r_lib_add_handler (l, R_LIB_TYPE_ASM, "(dis)assembly plugins",
&__lib_asm_cb, &__lib_asm_dt, NULL);
r_lib_opendir (l, r_sys_getenv ("LIBR_PLUGINS"));
path = r_sys_getenv ("LIBR_PLUGINS");
if (!path || !*path)
path = R2_PREFIX"/lib/radare2/last";
r_lib_opendir (l, path);
if (argc<2)
return rasm_show_help (0);

View File

@ -53,7 +53,7 @@ R_API int r_core_loadlibs(struct r_core_t *core) {
r_lib_opendir (core->lib, getenv (R_LIB_ENV));
// !!!! // r_lib_opendir (core->lib, ".");
r_lib_opendir (core->lib, homeplugindir);
r_lib_opendir (core->lib, R2_LIBDIR"/radare2/");
r_lib_opendir (core->lib, R2_LIBDIR"/radare2/last");
free (homeplugindir);
return R_TRUE;
}

View File

@ -167,14 +167,14 @@ static int samefile(const char *a, const char *b) {
if (sa != NULL && sb != NULL) {
do {
ptr = strstr(sa, "//");
ptr = strstr (sa, "//");
if (ptr) {
len = strlen (ptr+1) + 1;
memmove (ptr, ptr+1, len);
}
} while (ptr);
do {
ptr = strstr(sb, "//");
ptr = strstr (sb, "//");
if (ptr) {
len = strlen (ptr+1) + 1;
memmove (ptr, ptr+1, len);