summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--mrbgems/mruby-bin-mirb/tools/mirb/mirb.c10
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