changeset 693:9ed896f7b531

Use TH_DIR_SEPARATOR_CHR instead of our own define.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 05 Jan 2020 10:47:49 +0200
parents 863542691130
children 788a58dab07a
files main.c
diffstat 1 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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)