From c3d90c67640b72a57007d0f6261a5a30ed079be2 Mon Sep 17 00:00:00 2001 From: Sean Qureshi Date: Sun, 18 Aug 2013 03:25:18 -0700 Subject: Added mac support with data, standarized data --- testing/toxic/main.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'testing/toxic/main.c') 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[]) config_err = create_user_config_dir(user_config_dir); if (config_err) { - DATA_FILE = strdup("data"); + #if WIN32 + DATA_FILE = strdup("%appdata/.tox/data"); + #else + #if MAC_OSX + DATA_FILE = strdup("~Library/Application Support/data"); + #else + DATA_FILE = strdup("~/.tox/data"); + #endif + #endif } else { DATA_FILE = malloc(strlen(user_config_dir) + strlen(CONFIGDIR) + strlen("data") + 1); strcpy(DATA_FILE, user_config_dir); strcat(DATA_FILE, CONFIGDIR); - strcat(DATA_FILE, "data"); + #if WIN32 + DATA_FILE = strdup("%appdata/.tox/data"); + #else + #if MAC_OSX + DATA_FILE = strdup("~Library/Application Support/data"); + #else + DATA_FILE = strdup("~/.tox/data"); + #endif + #endif } } -- cgit v1.2.3