history_file = para_strdup(OPT_STRING_VAL(HISTORY_FILE));
else {
char *home = para_homedir();
- history_file = make_message("%s/.paraslash/play.history",
- home);
+ char *dot_para = make_message("%s/.paraslash", home);
+
free(home);
+ ret = para_mkdir(dot_para, 0777);
+ /* warn, but otherwise ignore mkdir error */
+ if (ret < 0 && ret != -ERRNO_TO_PARA_ERROR(EEXIST))
+ PARA_WARNING_LOG("Can not create %s: %s\n", dot_para,
+ para_strerror(-ret));
+ history_file = make_message("%s/play.history", dot_para);
+ free(dot_para);
}
ici.history_file = history_file;
ici.loglevel = loglevel;