Fix #4695 - no prompt after r2 -qp

This commit is contained in:
pancake 2016-04-26 19:11:11 +02:00
parent 5f279870d0
commit e9dc4ae89e
3 changed files with 7 additions and 9 deletions

View File

@ -850,8 +850,11 @@ int main(int argc, char **argv, char **envp) {
}
if (sandbox)
r_config_set (r.config, "cfg.sandbox", "true");
if (quiet)
if (quiet) {
r_config_set (r.config, "scr.wheel", "false");
r_config_set (r.config, "scr.interactive", "false");
r_config_set (r.config, "scr.prompt", "false");
}
r.num->value = 0;
if (patchfile) {

View File

@ -1,4 +1,4 @@
/* radare2 - LGPL - Copyright 2014-2015 - pancake */
/* radare2 - LGPL - Copyright 2014-2016 - pancake */
#include <r_asm.h>
#include <r_lib.h>
@ -20,13 +20,13 @@ static int disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, int len) {
if (ret) goto fin;
cs_option (handle, CS_OPT_DETAIL, CS_OPT_OFF);
n = cs_disasm (handle, (ut8*)buf, len, a->pc, 1, &insn);
if (n<1) {
if (n < 1) {
strcpy (op->buf_asm, "invalid");
op->size = 4;
ret = -1;
goto beach;
} else ret = 4;
if (insn->size<1)
if (insn->size < 1)
goto beach;
op->size = insn->size;
snprintf (op->buf_asm, R_ASM_BUFSIZE, "%s%s%s",
@ -47,8 +47,6 @@ RAsmPlugin r_asm_plugin_sparc_cs = {
.arch = "sparc",
.cpus = "v9",
.bits = 32|64,
.init = NULL,
.fini = NULL,
.disassemble = &disassemble,
.assemble = NULL
};

View File

@ -82,10 +82,7 @@ RAsmPlugin r_asm_plugin_sparc_gnu = {
.bits = 32|64,
.license = "GPL3",
.desc = "Scalable Processor Architecture",
.init = NULL,
.fini = NULL,
.disassemble = &disassemble,
.assemble = NULL
};
#ifndef CORELIB