diff options
| author | Joseph McCullough <[email protected]> | 2012-08-17 18:19:06 -0500 |
|---|---|---|
| committer | Joseph McCullough <[email protected]> | 2012-08-17 18:19:06 -0500 |
| commit | 618f25bfe2932b0296407a5c1d381273852214b5 (patch) | |
| tree | 9e695708d6a7e155e3c18166bdd5478450df6f3c /tools | |
| parent | bd3d5268db0f13af2ac35f6dbaf256f918bbae1a (diff) | |
| download | mruby-618f25bfe2932b0296407a5c1d381273852214b5.tar.gz mruby-618f25bfe2932b0296407a5c1d381273852214b5.zip | |
'exit' and 'quit' cause exit regardless of open block
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/mirb/mirb.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/tools/mirb/mirb.c b/tools/mirb/mirb.c index 54588d57e..073054b46 100644 --- a/tools/mirb/mirb.c +++ b/tools/mirb/mirb.c @@ -181,19 +181,9 @@ main(void) last_code_line[char_index] = '\0'; - if ((strcmp(last_code_line, "quit") == 0) || - (strcmp(last_code_line, "exit") == 0)) { - if (code_block_open) { - /* cancel the current block and reset */ - code_block_open = FALSE; - memset(ruby_code, 0, sizeof(*ruby_code)); - memset(last_code_line, 0, sizeof(*last_code_line)); - continue; - } - else { - /* quit the program */ - break; - } + if ((strcmp(last_code_line, "quit") == 0) || (strcmp(last_code_line, "exit") == 0)) { + /*:quit the program */ + break; } else { if (code_block_open) { |
