From 1ec71ac21278dc7c849515136c506e9255174dce Mon Sep 17 00:00:00 2001 From: pancake Date: Wed, 27 Jun 2018 01:02:24 +0200 Subject: [PATCH] Fix #10507 - 'op' command, no args show current fd --- libr/core/cmd_open.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libr/core/cmd_open.c b/libr/core/cmd_open.c index dae0da2b29..edd0bbe966 100644 --- a/libr/core/cmd_open.c +++ b/libr/core/cmd_open.c @@ -1136,18 +1136,22 @@ static int cmd_open(void *data, const char *input) { #endif case 'p': // "op" /* handle prioritize */ - { + if (input[1]) { int fd = r_num_math (core->num, input + 1); if (fd) { RIODesc *desc = r_io_desc_get (core->io, fd); if (desc) { // only useful for io.va=0 core->io->desc = desc; +#if 0 // load bininfo for given fd r_core_cmdf (core, "ob %d", fd); +#endif } } r_core_block_read (core); + } else { + r_cons_printf ("%d\n", core->io->desc->fd); } return 0; break;