mirror of
https://github.com/profanity-im/profanity.git
synced 2025-01-03 14:57:42 -05:00
Removed @ from log file names
This commit is contained in:
parent
4dcec36ef3
commit
6bbad269db
@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
#include "chat_log.h"
|
#include "chat_log.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
#include "util.h"
|
||||||
|
|
||||||
static GHashTable *logs;
|
static GHashTable *logs;
|
||||||
static GTimeZone *tz;
|
static GTimeZone *tz;
|
||||||
@ -51,11 +52,15 @@ void chat_log_chat(const char * const login, char *other,
|
|||||||
g_string_append(log_file, "/.profanity/log");
|
g_string_append(log_file, "/.profanity/log");
|
||||||
create_dir(log_file->str);
|
create_dir(log_file->str);
|
||||||
|
|
||||||
g_string_append_printf(log_file, "/%s", login);
|
char *login_dir = str_replace(login, "@", "_at_");
|
||||||
|
g_string_append_printf(log_file, "/%s", login_dir);
|
||||||
create_dir(log_file->str);
|
create_dir(log_file->str);
|
||||||
|
free(login_dir);
|
||||||
|
|
||||||
g_string_append_printf(log_file, "/%s.log", other);
|
char *other_file = str_replace(other, "@", "_at_");
|
||||||
|
g_string_append_printf(log_file, "/%s.log", other_file);
|
||||||
logp = fopen(log_file->str, "a");
|
logp = fopen(log_file->str, "a");
|
||||||
|
free(other_file);
|
||||||
|
|
||||||
g_string_free(log_file, TRUE);
|
g_string_free(log_file, TRUE);
|
||||||
g_hash_table_insert(logs, other, logp);
|
g_hash_table_insert(logs, other, logp);
|
||||||
|
@ -37,7 +37,8 @@ void get_time(char *thetime)
|
|||||||
}
|
}
|
||||||
|
|
||||||
char * str_replace (const char *string, const char *substr,
|
char * str_replace (const char *string, const char *substr,
|
||||||
const char *replacement) {
|
const char *replacement)
|
||||||
|
{
|
||||||
char *tok = NULL;
|
char *tok = NULL;
|
||||||
char *newstr = NULL;
|
char *newstr = NULL;
|
||||||
char *oldstr = NULL;
|
char *oldstr = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user