# HG changeset patch # User Matti Hamalainen # Date 1578214069 -7200 # Node ID 9ed896f7b531f6e47d89ad6cf19ccef2804da2b8 # Parent 86354269113051d8be0f7aa9ffa26756db8ff5a0 Use TH_DIR_SEPARATOR_CHR instead of our own define. diff -r 863542691130 -r 9ed896f7b531 main.c --- a/main.c Wed Dec 25 15:40:35 2019 +0200 +++ b/main.c Sun Jan 05 10:47:49 2020 +0200 @@ -23,9 +23,7 @@ #ifdef TH_PLAT_WINDOWS # define SET_CONFIG_FILE "nnchat.txt" # define SET_LOG_DIR "NNChat Log Files" -# define SET_DIR_SEPARATOR '\\' #else -# define SET_DIR_SEPARATOR '/' # define SET_LOG_DIR "nnlogs" # if defined(USE_XDG) # define SET_XDG_CONFIG_DIR "nnchat" @@ -1845,9 +1843,9 @@ if (!optLogEnable || optLogPath == NULL) return FALSE; - plt = strrchr(optLogPath, SET_DIR_SEPARATOR); + plt = strrchr(optLogPath, TH_DIR_SEPARATOR_CHR); if (plt == NULL || plt[1] != 0) - path = th_strdup_printf("%s%c", optLogPath, SET_DIR_SEPARATOR); + path = th_strdup_printf("%s%c", optLogPath, TH_DIR_SEPARATOR_CHR); else path = th_strdup(optLogPath); @@ -2054,7 +2052,7 @@ { th_ioctx *ctx; - setConfigFile = th_strdup_printf("%s%c%s", setConfigDir, SET_DIR_SEPARATOR, SET_CONFIG_FILE); + setConfigFile = th_strdup_printf("%s%c%s", setConfigDir, TH_DIR_SEPARATOR_CHR, SET_CONFIG_FILE); if (th_io_fopen(&ctx, &th_stdio_io_ops, setConfigFile, "r") == THERR_OK) { th_io_set_handlers(ctx, nn_ioctx_errfunc, nn_ioctx_msgfunc); @@ -2079,7 +2077,7 @@ if (optLogPath == NULL && setHomeDir != NULL) { optLogPath = th_strdup_printf("%s%c%s%c", - setHomeDir, SET_DIR_SEPARATOR, SET_LOG_DIR, SET_DIR_SEPARATOR); + setHomeDir, TH_DIR_SEPARATOR_CHR, SET_LOG_DIR, TH_DIR_SEPARATOR_CHR); } if (optLogEnable)