Merge fixups
This commit is contained in:
commit
c0db3c408d
@ -672,9 +672,11 @@ static void irc_cli_backlog(struct link_client *ic)
|
|||||||
|
|
||||||
backlogl = log_backlogs(LINK(ic)->log);
|
backlogl = log_backlogs(LINK(ic)->log);
|
||||||
while ((bl = list_remove_first(backlogl))) {
|
while ((bl = list_remove_first(backlogl))) {
|
||||||
|
list_t *bllines;
|
||||||
|
bllines = backlog_lines_from_last_mark(LINK(ic)->log, bl);
|
||||||
mylog(LOG_INFO, "backlogging: %s", bl);
|
mylog(LOG_INFO, "backlogging: %s", bl);
|
||||||
write_lines(CONN(ic),
|
write_lines(CONN(ic), bllines);
|
||||||
backlog_lines_from_last_mark(LINK(ic)->log, bl));
|
list_free(bllines);
|
||||||
free(bl);
|
free(bl);
|
||||||
}
|
}
|
||||||
list_free(backlogl);
|
list_free(backlogl);
|
||||||
|
19
src/util.c
19
src/util.c
@ -424,19 +424,20 @@ void list_free(list_t *t)
|
|||||||
free(t);
|
free(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
void list_append(list_t *src, list_t *dest)
|
void list_append(list_t *dest, list_t *src)
|
||||||
{
|
{
|
||||||
if (dest->last == NULL)
|
if (src->last == NULL)
|
||||||
return;
|
return;
|
||||||
if (src->first == NULL) {
|
if (dest->first == NULL) {
|
||||||
src->first = dest->first;
|
dest->first = src->first;
|
||||||
src->last = dest->last;
|
dest->last = src->last;
|
||||||
|
src->first = src->last = NULL;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dest->first->prev = src->last;
|
src->first->prev = dest->last;
|
||||||
src->last->next = dest->first;
|
dest->last->next = src->first;
|
||||||
src->last = dest->last;
|
dest->last = src->last;
|
||||||
free(dest);
|
src->first = src->last = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -116,8 +116,7 @@ void list_it_init(list_t *list, list_iterator_t *ti);
|
|||||||
void list_it_init_last(list_t *list, list_iterator_t *ti);
|
void list_it_init_last(list_t *list, list_iterator_t *ti);
|
||||||
void *list_it_remove(list_iterator_t *li);
|
void *list_it_remove(list_iterator_t *li);
|
||||||
void list_free(list_t *t);
|
void list_free(list_t *t);
|
||||||
/* dest must not be refed after wards */
|
void list_append(list_t *dest, list_t *src);
|
||||||
void list_append(list_t *src, list_t *dest);
|
|
||||||
int list_is_empty(list_t *l);
|
int list_is_empty(list_t *l);
|
||||||
|
|
||||||
static inline void list_it_next(list_iterator_t *ti)
|
static inline void list_it_next(list_iterator_t *ti)
|
||||||
|
Loading…
Reference in New Issue
Block a user