hirc

IRC client
Log | Files | Refs

commit 0cdf7515f9ea0f56d622a7d68cd4b49e7719c4fd
parent 51156e19ca436a357fda547b99d54bf25eaf0451
Author: hhvn <dev@hhvn.uk>
Date:   Fri, 22 Apr 2022 17:12:56 +0100

Fix hist_loadlog for versioned logs

Diffstat:
Msrc/hist.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/hist.c b/src/hist.c @@ -377,7 +377,7 @@ hist_loadlog(struct HistInfo *hist, char *server, char *channel) { version = strtok_r(lines[i], "\t", &msg) + 1; /* in future versioning could allow for back-compat */ else version = NULL; - tok[0] = strtok_r(lines[i], "\t", &msg); + tok[0] = strtok_r(*lines[i] == 'v' ? NULL : lines[i], "\t", &msg); for (j = 1; j < (sizeof(tok) / sizeof(tok[0])); j++) tok[j] = strtok_r(NULL, "\t", &msg); /* strtok_r will store remaining text after the tokens in msg. * This is used instead of a tok[8] as messages can contain tabs. */