From 62f2773b693da32dab5eed2520a8c51b3f4a8e62 Mon Sep 17 00:00:00 2001 From: pancake Date: Tue, 27 Jan 2015 17:06:01 +0100 Subject: [PATCH] 'exit' or empty line to quit remote shell mode from r2 -C --- libr/core/rtr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libr/core/rtr.c b/libr/core/rtr.c index 56f6dce401..055f271b78 100644 --- a/libr/core/rtr.c +++ b/libr/core/rtr.c @@ -882,6 +882,8 @@ R_API void r_core_rtr_add(RCore *core, const char *_input) { for (;;) { r_line_set_prompt (prompt2); res = r_line_readline (); + if (!res || !*res || !strcmp (res, "exit")) + break; ptr = r_str_uri_encode (res); snprintf (uri, sizeof (uri), "http://%s:%s/%s!%s", @@ -897,8 +899,7 @@ R_API void r_core_rtr_add(RCore *core, const char *_input) { free (str); } } - } - if (str[0]=='V') { + } else if (str[0]=='V') { if (str[1]==' ') { rtr_visual (core, T, str+1); } else {