Skip to content

Commit

Permalink
Permit setting eval var values ending with a dot ##core
Browse files Browse the repository at this point in the history
  • Loading branch information
radare authored and trufae committed Sep 24, 2024
1 parent acd1d8f commit 2578ff0
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions libr/core/cmd_eval.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -831,15 +831,19 @@ static int cmd_eval(void *data, const char *input) {
break;
case '.': // "e "
case ' ': // "e "
if (r_str_endswith (input, ".") && !r_str_endswith (input, "..")) {
r_config_list (core->config, input + 1, 0);
} else if (r_str_endswith (input, ".?")) {
char *w = r_str_ndup (input, strlen (input) - 1);
r_config_list (core->config, w, 2);
free (w);
} else {
// XXX we cant do "e cmd.gprompt=dr=", because the '=' is a token, and quotes dont affect him
if (strchr (input, '=')) {
r_config_eval (core->config, r_str_trim_head_ro (input + 1), false);
} else {
if (r_str_endswith (input, ".") && !r_str_endswith (input, "..")) {
r_config_list (core->config, input + 1, 0);
} else if (r_str_endswith (input, ".?")) {
char *w = r_str_ndup (input, strlen (input) - 1);
r_config_list (core->config, w, 2);
free (w);
} else {
// XXX we cant do "e cmd.gprompt=dr=", because the '=' is a token, and quotes dont affect him
r_config_eval (core->config, r_str_trim_head_ro (input + 1), false);
}
}
break;
}
Expand Down

0 comments on commit 2578ff0

Please sign in to comment.