sfeed_curses

[fork] sfeed (atom feed) reader
Log | Files | Refs | README | LICENSE

commit 331e8705a41a6e858e4b7474c77e8016999a3cbe
parent a6b7e959ba2a3a8f19e0dcbe70226d95f18b0e5a
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Tue, 14 Jul 2020 21:33:17 +0200

fix crash when reopening a feed (stdin) from the sidebar

Reproduce:
* Toggle sidebar with 's'.
* Select "stdin".
* Open feed ('o').

Diffstat:
Msfeed_curses.c | 8++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/sfeed_curses.c b/sfeed_curses.c @@ -1157,6 +1157,8 @@ feeds_load(struct feed *feeds, size_t nfeeds) err(1, "fopen: %s", f->path); } } + if (!f->fp) + continue; /* load first items, because of first selection or stdin. */ if (i == 0 || f == curfeed) { @@ -1314,7 +1316,8 @@ mousereport(int button, int release, int x, int y) row = pane_row_get(p, pos); f = (struct feed *)row->data; feeds_set(f); - feed_load(f, f->fp); + if (f->fp) + feed_load(f, f->fp); /* redraw row: counts could be changed */ pane_row_draw(p, pos); updatetitle(); @@ -1674,7 +1677,8 @@ nextpage: row = pane_row_get(p, p->pos); f = (struct feed *)row->data; feeds_set(f); - feed_load(f, f->fp); + if (f->fp) + feed_load(f, f->fp); /* redraw row: counts could be changed */ pane_row_draw(p, p->pos); updatetitle();