From d7d8b095800cc677e511040a3a8b3953ae4e28b1 Mon Sep 17 00:00:00 2001 From: takkaw Date: Wed, 5 Mar 2014 23:30:09 +0900 Subject: small refactor --- mrbgems/mruby-bin-mirb/tools/mirb/mirb.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c b/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c index b204c8e2d..a42577a57 100644 --- a/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c +++ b/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c @@ -322,24 +322,15 @@ main(int argc, char **argv) free(line); #endif - if ((strcmp(last_code_line, "quit") == 0) || (strcmp(last_code_line, "exit") == 0)) { - if (!code_block_open) { - break; - } - else{ - /* count the quit/exit commands as strings if in a quote block */ + if (code_block_open) { strcat(ruby_code, "\n"); strcat(ruby_code, last_code_line); - } } else { - if (code_block_open) { - strcat(ruby_code, "\n"); - strcat(ruby_code, last_code_line); - } - else { - strcpy(ruby_code, last_code_line); + if ((strcmp(last_code_line, "quit") == 0) || (strcmp(last_code_line, "exit") == 0)) { + break; } + strcpy(ruby_code, last_code_line); } /* parse code */ -- cgit v1.2.3