summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'config.c')
-rw-r--r--config.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/config.c b/config.c
index d1efc87..eab0308 100644
--- a/config.c
+++ b/config.c
@@ -11,6 +11,27 @@
#define MAX_NEST 30 //way more than I'll ever need
+#ifdef _WIN32
+char * strtok_r(char * input, char * sep, char ** state)
+{
+ if (input) {
+ *state = input;
+ }
+ char * ret = *state;
+ while (**state && **state != *sep)
+ {
+ ++*state;
+ }
+ if (**state)
+ {
+ **state = 0;
+ ++*state;
+ return ret;
+ }
+ return NULL;
+}
+#endif
+
tern_node * parse_config(char * config_data)
{
char *state, *curline;
@@ -101,7 +122,7 @@ open_fail:
tern_node * load_config()
{
char * exe_dir;
- char * home = getenv("HOME");
+ char * home = get_home_dir();
if (!home) {
goto load_in_app_dir;
}