Mercurial > repos > blastem
comparison config.c @ 742:2e1b3b258523
Make Windows port a little less half-assed
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 01 Apr 2014 21:12:00 -0700 |
parents | 80a67be1770b |
children | 1b2f8280ba81 |
comparison
equal
deleted
inserted
replaced
741:80a67be1770b | 742:2e1b3b258523 |
---|---|
119 return ret; | 119 return ret; |
120 } | 120 } |
121 | 121 |
122 tern_node * load_config() | 122 tern_node * load_config() |
123 { | 123 { |
124 #ifdef _WIN32 | |
125 tern_node * ret = parse_config_file("default.cfg"); | |
126 #else | |
127 char * exe_dir; | 124 char * exe_dir; |
128 char * home = getenv("HOME"); | 125 char * home = get_home_dir(); |
129 if (!home) { | 126 if (!home) { |
130 goto load_in_app_dir; | 127 goto load_in_app_dir; |
131 } | 128 } |
132 char * path = alloc_concat(home, "/.config/blastem/blastem.cfg"); | 129 char * path = alloc_concat(home, "/.config/blastem/blastem.cfg"); |
133 tern_node * ret = parse_config_file(path); | 130 tern_node * ret = parse_config_file(path); |
141 goto no_config; | 138 goto no_config; |
142 } | 139 } |
143 path = alloc_concat(exe_dir, "/default.cfg"); | 140 path = alloc_concat(exe_dir, "/default.cfg"); |
144 ret = parse_config_file(path); | 141 ret = parse_config_file(path); |
145 free(path); | 142 free(path); |
146 #endif | |
147 success: | 143 success: |
148 if (ret) { | 144 if (ret) { |
149 return ret; | 145 return ret; |
150 } | 146 } |
151 no_config: | 147 no_config: |