Mercurial > ~mikael > mcabber > hg
comparison mcabber/mcabber/hbuf.c @ 1967:f016c9c9d992
Update hbuf_jump_readmark()
Needed after recent changes
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Fri, 18 Mar 2011 19:35:25 +0100 |
parents | 88dafee4ee49 |
children | 10eead2ba1b7 |
comparison
equal
deleted
inserted
replaced
1966:88dafee4ee49 | 1967:f016c9c9d992 |
---|---|
437 // Return a pointer to the line following the readmark | 437 // Return a pointer to the line following the readmark |
438 // or NULL if no mark was found. | 438 // or NULL if no mark was found. |
439 GList *hbuf_jump_readmark(GList *hbuf) | 439 GList *hbuf_jump_readmark(GList *hbuf) |
440 { | 440 { |
441 hbuf_block *blk; | 441 hbuf_block *blk; |
442 GList *r = NULL; | |
442 | 443 |
443 hbuf = g_list_last(hbuf); | 444 hbuf = g_list_last(hbuf); |
444 for ( ; hbuf; hbuf = g_list_previous(hbuf)) { | 445 for ( ; hbuf; hbuf = g_list_previous(hbuf)) { |
445 blk = (hbuf_block*)(hbuf->data); | 446 blk = (hbuf_block*)(hbuf->data); |
446 if (blk->prefix.flags & HBB_PREFIX_READMARK) | 447 if (blk->prefix.flags & HBB_PREFIX_READMARK) |
447 return g_list_next(hbuf); | 448 return r; |
449 if ((blk->flags & HBB_FLAG_PERSISTENT) && | |
450 (blk->prefix.flags & ~HBB_PREFIX_READMARK)) | |
451 r = hbuf; | |
448 } | 452 } |
449 | 453 |
450 return NULL; | 454 return NULL; |
451 } | 455 } |
452 | 456 |