Merge pull request #1811 from takkaw/refactor_mirb

small refactor in mirb
This commit is contained in:
Yukihiro "Matz" Matsumoto
2014-03-06 00:20:41 +09:00
+4 -13
View File
@@ -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 */