Do not ask yesno for decompiler if it is not even available ##panels (#13791)

This commit is contained in:
Vanellope 2019-04-17 03:06:02 +09:00 committed by radare
parent 69e137d3b6
commit 3bf54a4a9a

View File

@ -1499,7 +1499,7 @@ static void delPanel(RPanels *panels, int delPanelNum) {
}
static void delCurPanel(RPanels *panels) {
if (panels->n_panels <= 2) {
if (panels->n_panels <= 1) {
return;
}
dismantlePanel (panels);
@ -3544,16 +3544,17 @@ static bool moveToDirection(RPanels *panels, Direction direction) {
}
static void createDefaultPanels(RCore *core) {
const char *msg = "Activate decompiler? It might take some time.(Y/n)";
bool decompiler_yesno = r_cons_yesno ('y', msg);
RAnalFunction *fun = r_anal_get_fcn_in (core->anal, core->offset, R_ANAL_FCN_TYPE_NULL);
RPanels *panels = core->panels;
panels->curnode = 0;
panels->n_panels = 0;
RAnalFunction *fun = r_anal_get_fcn_in (core->anal, core->offset, R_ANAL_FCN_TYPE_NULL);
bool decompiler_on = false;
if (fun && !r_list_empty (fun->bbs)) {
const char *msg = "Activate decompiler? It might take some time.(Y/n)";
decompiler_on = r_cons_yesno ('y', msg);
}
int i = 0;
bool decompiler_on = decompiler_yesno && fun && !r_list_empty (fun->bbs);
if (panels->layout == PANEL_LAYOUT_DEFAULT_DYNAMIC) {
while (panels_dynamic[i]) {
RPanel *p = getPanel (panels, panels->n_panels);