Commit 1fe65b25 authored by kyab's avatar kyab

Use env[USERPROFILE] for Windows

parent 4306fe79
...@@ -253,6 +253,7 @@ main(int argc, char **argv) ...@@ -253,6 +253,7 @@ main(int argc, char **argv)
int n; int n;
int code_block_open = FALSE; int code_block_open = FALSE;
int ai; int ai;
char *home = NULL;
/* new interpreter instance */ /* new interpreter instance */
mrb = mrb_open(); mrb = mrb_open();
...@@ -279,7 +280,12 @@ main(int argc, char **argv) ...@@ -279,7 +280,12 @@ main(int argc, char **argv)
#ifdef ENABLE_READLINE #ifdef ENABLE_READLINE
using_history(); using_history();
strcpy(history_path, getenv("HOME")); home = getenv("HOME");
#ifdef _WIN32
if (!home)
home = getenv("USERPROFILE");
#endif
strcpy(history_path, home);
strcat(history_path, "/"); strcat(history_path, "/");
strcat(history_path, history_file_name); strcat(history_path, history_file_name);
read_history(history_path); read_history(history_path);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment