]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - client.c
Merge topic branch t/misc into pu
[paraslash.git] / client.c
index 84b7580cf9554c433651da1f3eed28a6f1f39a74..75519091670b73297ffd9e7010756c4eb6784f5e 100644 (file)
--- a/client.c
+++ b/client.c
@@ -525,15 +525,9 @@ __noreturn static void interactive_session(void)
        };
 
        PARA_NOTICE_LOG("\n%s\n", version_text("client"));
-       if (CLIENT_OPT_GIVEN(HISTORY_FILE, ct->lpr))
-               ici.history_file = para_strdup(CLIENT_OPT_STRING_VAL(
-                       HISTORY_FILE, ct->lpr));
-       else {
-               char *home = para_homedir();
-               ici.history_file = make_message("%s/.paraslash/client.history",
-                       home);
-               free(home);
-       }
+       ici.history_file = CLIENT_OPT_GIVEN(HISTORY_FILE, ct->lpr)?
+               para_strdup(CLIENT_OPT_STRING_VAL(HISTORY_FILE, ct->lpr)) :
+               make_message("%s/client.history", get_confdir());
        act.sa_handler = i9e_signal_dispatch;
        sigemptyset(&act.sa_mask);
        act.sa_flags = 0;
@@ -549,6 +543,7 @@ __noreturn static void interactive_session(void)
        i9e_close();
        para_log = stderr_log;
 out:
+       free(ici.history_file);
        if (ret < 0)
                PARA_ERROR_LOG("%s\n", para_strerror(-ret));
        exit(ret < 0? EXIT_FAILURE : EXIT_SUCCESS);