1
0
forked from bip/bip

Merge fixups

This commit is contained in:
Arnaud Cornet 2008-12-28 14:47:44 +01:00
commit c0db3c408d
3 changed files with 15 additions and 13 deletions

View File

@ -672,9 +672,11 @@ static void irc_cli_backlog(struct link_client *ic)
backlogl = log_backlogs(LINK(ic)->log);
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);
write_lines(CONN(ic),
backlog_lines_from_last_mark(LINK(ic)->log, bl));
write_lines(CONN(ic), bllines);
list_free(bllines);
free(bl);
}
list_free(backlogl);

View File

@ -424,19 +424,20 @@ void list_free(list_t *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;
if (src->first == NULL) {
src->first = dest->first;
src->last = dest->last;
if (dest->first == NULL) {
dest->first = src->first;
dest->last = src->last;
src->first = src->last = NULL;
return;
}
dest->first->prev = src->last;
src->last->next = dest->first;
src->last = dest->last;
free(dest);
src->first->prev = dest->last;
dest->last->next = src->first;
dest->last = src->last;
src->first = src->last = NULL;
}
/*

View File

@ -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_remove(list_iterator_t *li);
void list_free(list_t *t);
/* dest must not be refed after wards */
void list_append(list_t *src, list_t *dest);
void list_append(list_t *dest, list_t *src);
int list_is_empty(list_t *l);
static inline void list_it_next(list_iterator_t *ti)