# HG changeset patch # User Matti Hamalainen # Date 1352712497 -7200 # Node ID 895ede06ff11a40a8a6fcc14f1ca018bf7069d35 # Parent e30fa8592a48a36845297d2dedb2f3097719be02 Implement default log file directory. diff -r e30fa8592a48 -r 895ede06ff11 main.c --- a/main.c Sun Nov 11 19:08:21 2012 +0200 +++ b/main.c Mon Nov 12 11:28:17 2012 +0200 @@ -17,13 +17,17 @@ #define random rand #else #include +#include +#include #endif #ifdef __WIN32 #define SET_CONFIG_FILE "nnchat.txt" +#define SET_LOG_DIR "NNChat Log Files" #define SET_DIR_SEPARATOR '\\' #else #define SET_CONFIG_FILE ".nnchat" +#define SET_LOG_DIR "nnlogs" #define SET_DIR_SEPARATOR '/' #endif @@ -1694,6 +1698,12 @@ if (setBrowser == NULL) setBrowser = "firefox"; + if (optLogPath == NULL) + { + optLogPath = th_strdup_printf("%s%c%s%c", + setHomeDir, SET_DIR_SEPARATOR, SET_LOG_DIR, SET_DIR_SEPARATOR); + } + // Parse command line arguments argsOK = th_args_process(argc, argv, optList, optListN, argHandleOpt, argHandleFile, FALSE);