diff options
author | Sean Qureshi <stqism@risingstormgames.com> | 2013-08-18 03:25:18 -0700 |
---|---|---|
committer | Sean Qureshi <stqism@risingstormgames.com> | 2013-08-18 03:25:18 -0700 |
commit | c3d90c67640b72a57007d0f6261a5a30ed079be2 (patch) | |
tree | 44b0090c0093f68b1c87bd8664ab4c510825708c /testing/toxic | |
parent | ab830825bdf8d5f5c2447c534735cef959af52b0 (diff) |
Added mac support with data, standarized data
Diffstat (limited to 'testing/toxic')
-rw-r--r-- | testing/toxic/main.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/testing/toxic/main.c b/testing/toxic/main.c index f9cb1b1c..52e810d6 100644 --- a/testing/toxic/main.c +++ b/testing/toxic/main.c | |||
@@ -289,12 +289,28 @@ int main(int argc, char *argv[]) | |||
289 | config_err = create_user_config_dir(user_config_dir); | 289 | config_err = create_user_config_dir(user_config_dir); |
290 | 290 | ||
291 | if (config_err) { | 291 | if (config_err) { |
292 | DATA_FILE = strdup("data"); | 292 | #if WIN32 |
293 | DATA_FILE = strdup("%appdata/.tox/data"); | ||
294 | #else | ||
295 | #if MAC_OSX | ||
296 | DATA_FILE = strdup("~Library/Application Support/data"); | ||
297 | #else | ||
298 | DATA_FILE = strdup("~/.tox/data"); | ||
299 | #endif | ||
300 | #endif | ||
293 | } else { | 301 | } else { |
294 | DATA_FILE = malloc(strlen(user_config_dir) + strlen(CONFIGDIR) + strlen("data") + 1); | 302 | DATA_FILE = malloc(strlen(user_config_dir) + strlen(CONFIGDIR) + strlen("data") + 1); |
295 | strcpy(DATA_FILE, user_config_dir); | 303 | strcpy(DATA_FILE, user_config_dir); |
296 | strcat(DATA_FILE, CONFIGDIR); | 304 | strcat(DATA_FILE, CONFIGDIR); |
297 | strcat(DATA_FILE, "data"); | 305 | #if WIN32 |
306 | DATA_FILE = strdup("%appdata/.tox/data"); | ||
307 | #else | ||
308 | #if MAC_OSX | ||
309 | DATA_FILE = strdup("~Library/Application Support/data"); | ||
310 | #else | ||
311 | DATA_FILE = strdup("~/.tox/data"); | ||
312 | #endif | ||
313 | #endif | ||
298 | } | 314 | } |
299 | } | 315 | } |
300 | 316 | ||