]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - audioc.c
Merge topic branch t/sf_float into pu
[paraslash.git] / audioc.c
index f2e4cb91de228dcd78cae534e08d76e8514b6d88..83b1930c732ef1fbecfefb6441672eee5fafad80 100644 (file)
--- a/audioc.c
+++ b/audioc.c
@@ -231,7 +231,6 @@ close:
 __noreturn static void interactive_session(void)
 {
        int ret;
-       char *history_file;
        struct sigaction act;
        struct i9e_client_info ici = {
                .fds = {0, 1, 2},
@@ -242,16 +241,9 @@ __noreturn static void interactive_session(void)
        };
 
        PARA_NOTICE_LOG("\n%s\n", version_text("audioc"));
-       if (OPT_GIVEN(HISTORY_FILE))
-               history_file = para_strdup(OPT_STRING_VAL(HISTORY_FILE));
-       else {
-               char *home = para_homedir();
-               history_file = make_message("%s/.paraslash/audioc.history",
-                       home);
-               free(home);
-       }
-       ici.history_file = history_file;
-
+       ici.history_file = OPT_GIVEN(HISTORY_FILE)?
+               para_strdup(OPT_STRING_VAL(HISTORY_FILE)) :
+               make_message("%s/audioc.history", get_confdir());
        act.sa_handler = i9e_signal_dispatch;
        sigemptyset(&act.sa_mask);
        act.sa_flags = 0;
@@ -268,7 +260,7 @@ __noreturn static void interactive_session(void)
        i9e_close();
        para_log = stderr_log;
 out:
-       free(history_file);
+       free(ici.history_file);
        free(socket_name);
        if (ret < 0)
                PARA_ERROR_LOG("%s\n", para_strerror(-ret));