diff options
| author | mattn <[email protected]> | 2013-07-23 12:13:50 +0900 |
|---|---|---|
| committer | mattn <[email protected]> | 2013-07-23 12:13:50 +0900 |
| commit | c8f1f7fdf617b1b383042f5bcae0a1abca3e5883 (patch) | |
| tree | d618cbcc7a6a568f51ae5780f35b3c4b8017c74c | |
| parent | 29a3f8b8e3826551daedbc4802a12ae2411a0351 (diff) | |
| download | mruby-c8f1f7fdf617b1b383042f5bcae0a1abca3e5883.tar.gz mruby-c8f1f7fdf617b1b383042f5bcae0a1abca3e5883.zip | |
Check home is null
| -rw-r--r-- | mrbgems/mruby-bin-mirb/tools/mirb/mirb.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c b/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c index 3111eea8f..e9bbb5420 100644 --- a/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c +++ b/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c @@ -285,10 +285,12 @@ main(int argc, char **argv) if (!home) home = getenv("USERPROFILE"); #endif - strcpy(history_path, home); - strcat(history_path, "/"); - strcat(history_path, history_file_name); - read_history(history_path); + if (home) { + strcpy(history_path, home); + strcat(history_path, "/"); + strcat(history_path, history_file_name); + read_history(history_path); + } #endif |
