Skip to content

Commit

Permalink
Improve Lc/Lc- to handle home and extension less plugins ##core
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Jan 24, 2025
1 parent 8741d91 commit 40fe8e8
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion libr/core/cmd_log.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -639,8 +639,26 @@ static int cmd_plugins(void *data, const char *input) {
pj_free (pj);
break;
}
case '-':
r_core_cmd_callf (core, "L-%s", r_str_trim_head_ro (input + 2));
break;
case ' ':
r_lib_open (core->lib, r_str_trim_head_ro (input + 2));
{
const char *arg = r_str_trim_head_ro (input + 2);
char *p = r_file_home (arg);
if (r_file_exists (p)) {
r_lib_open (core->lib, p);
} else {
if (strchr (arg, '.')) {
r_lib_open (core->lib, arg);
} else {
char *q = r_str_newf ("%s.%s", arg, R_LIB_EXT);
r_lib_open (core->lib, q);
free (q);
}
}
free (p);
}
break;
case 'v':
r_lib_list (core->lib);
Expand Down

0 comments on commit 40fe8e8

Please sign in to comment.