diff options
| author | Carson McDonald <[email protected]> | 2013-02-17 07:23:32 -0500 |
|---|---|---|
| committer | Carson McDonald <[email protected]> | 2013-02-17 07:23:32 -0500 |
| commit | fb5e83a69b86ec76ccd2b321d0628fc15e00b46c (patch) | |
| tree | aeb41768bb34d44f4b67ddc69e58109d933c3cf2 /tools | |
| parent | 92cf2a0ced00cf4071d624eb2d842867a6d054c2 (diff) | |
| download | mruby-fb5e83a69b86ec76ccd2b321d0628fc15e00b46c.tar.gz mruby-fb5e83a69b86ec76ccd2b321d0628fc15e00b46c.zip | |
Fix crash when exiting mirb using ctrl-d when compiled with readline
support.
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/mirb/mirb.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/mirb/mirb.c b/tools/mirb/mirb.c index 85c3249d2..29685cf28 100644 --- a/tools/mirb/mirb.c +++ b/tools/mirb/mirb.c @@ -191,6 +191,10 @@ main(void) last_code_line[char_index] = '\0'; #else char* line = readline(code_block_open ? "* " : "> "); + if(line == NULL) { + printf("\n"); + break; + } strncat(last_code_line, line, sizeof(last_code_line)-1); add_history(line); free(line); |
