diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-07-23 05:45:33 -0700 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-07-23 05:45:33 -0700 |
| commit | 0591413ebdc871af8b2a0eace329cc8baade8f7d (patch) | |
| tree | 0d993c443e6ae47904c924f2deea8281280948b0 /mrbgems/mruby-bin-mirb/tools | |
| parent | 9783e9d81cd933445f7aaff13ff58f2791e401d2 (diff) | |
| parent | c8f1f7fdf617b1b383042f5bcae0a1abca3e5883 (diff) | |
| download | mruby-0591413ebdc871af8b2a0eace329cc8baade8f7d.tar.gz mruby-0591413ebdc871af8b2a0eace329cc8baade8f7d.zip | |
Merge pull request #1402 from mattn/check_home_is_null
Check home is null
Diffstat (limited to 'mrbgems/mruby-bin-mirb/tools')
| -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 5867d9a14..50556e092 100644 --- a/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c +++ b/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c @@ -286,10 +286,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 |
