commit 7ba7789acff0f89f2953fc02bf9866c1261e0541
parent d912eeee3c04b80bf71670de1043d1515a9e2943
Author: Antoine Amarilli <a3nm@a3nm.net>
Date: Fri, 27 Jul 2012 22:27:31 +0200
fix bug in use of set_last_idxes
Diffstat:
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/irctk.c b/irctk.c
@@ -814,7 +814,7 @@ void push_fifo_set(fifo_set *s, char *fl, char *dests, char *l) {
// debug("first_ptr is %p full line %s, first_dest is %s", first_ptr,
// first_ptr->full_line, first_dest);
- set_last_idxes(s, first_dest, first_fifoidx, first_lineidx);
+ set_last_idxes(s, first_dest, fifoidx, lineidx);
post_push(s, was_empty);
}
@@ -823,7 +823,6 @@ void push_fifo_set_all(fifo_set *s, char *fl, char **dests, int ndests, char *l)
pre_push(s);
int was_empty;
int i = 0;
- int first_fifoidx = -1, first_lineidx = -1;
int fifoidx = 0, lineidx = 0, nfifoidx = 0, nlineidx = 0;
assert(ndests > 0);
@@ -833,19 +832,13 @@ void push_fifo_set_all(fifo_set *s, char *fl, char **dests, int ndests, char *l)
push_one(s, i?NULL:fl, dests[i], l, fifoidx, lineidx, &nfifoidx, &nlineidx);
fifoidx = nfifoidx;
lineidx = nlineidx;
- if (first_fifoidx < 0) {
- first_fifoidx = fifoidx;
- first_lineidx = lineidx;
- // debug("first_ptr is %p full line %s, first_dest is %s", first_ptr,
- // first_ptr->full_line, first_dest);
- }
}
//debug("DDD %s", s->fifos[0].queue[0].line);
debug("finished at i:%d", i);
// debug("first_ptr is %p full line %s, first_dest is %s", first_ptr,
// first_ptr->full_line, first_dest);
- set_last_idxes(s, dests[0], first_fifoidx, first_lineidx);
+ set_last_idxes(s, dests[0], fifoidx, lineidx);
post_push(s, was_empty);
}