diff options
| author | takkaw <[email protected]> | 2014-03-05 23:30:09 +0900 |
|---|---|---|
| committer | takkaw <[email protected]> | 2014-03-05 23:35:34 +0900 |
| commit | d7d8b095800cc677e511040a3a8b3953ae4e28b1 (patch) | |
| tree | 34998d3fd0c1888bd2f1e1d2b57276d31ecc11be | |
| parent | faf48bb761e4ee03115dc88d7588d1a7afa83270 (diff) | |
| download | mruby-d7d8b095800cc677e511040a3a8b3953ae4e28b1.tar.gz mruby-d7d8b095800cc677e511040a3a8b3953ae4e28b1.zip | |
small refactor
| -rw-r--r-- | mrbgems/mruby-bin-mirb/tools/mirb/mirb.c | 17 |
1 files 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 */ |
