diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-02-17 16:09:43 -0800 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-02-17 16:09:43 -0800 |
| commit | b04183fd9cc0297005fbe378d2c136516999b82a (patch) | |
| tree | e100714c906da061e3a53869952c6a317da85c7d | |
| parent | 794406145344ee956ac024f07c37f9e011fbfa28 (diff) | |
| parent | fb5e83a69b86ec76ccd2b321d0628fc15e00b46c (diff) | |
| download | mruby-b04183fd9cc0297005fbe378d2c136516999b82a.tar.gz mruby-b04183fd9cc0297005fbe378d2c136516999b82a.zip | |
Merge pull request #848 from carsonmcdonald/mirbreadlinefix
Fix mirb crash
| -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); |
