Skip to content

Commit

Permalink
small refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
takkaw committed Mar 5, 2014
1 parent faf48bb commit d7d8b09
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions mrbgems/mruby-bin-mirb/tools/mirb/mirb.c
Expand Up @@ -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 */
Expand Down

0 comments on commit d7d8b09

Please sign in to comment.