commit c35879a5e2f2171fb55c25b102f818876c122b4f
parent b6e76ef2d7f254744f9af79ca5f23e5b8ffb71d5
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Fri, 17 Jul 2020 14:01:37 +0200
if not using an urlfile then do not load links unnecesarily in memory
Diffstat:
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/sfeed_curses.c b/sfeed_curses.c
@@ -96,7 +96,7 @@ struct feed {
};
struct item {
- char *link; /* separate link field (always loaded) */
+ char *link; /* separate link field (always loaded in case of urlfile) */
char *fields[FieldLast];
char *line; /* allocated split line */
time_t timestamp;
@@ -1004,7 +1004,8 @@ linetoitem(char *line, struct item *item)
item->line = line;
parseline(line, fields);
memcpy(item->fields, fields, sizeof(fields));
- item->link = estrdup(fields[FieldLink]);
+ if (urlfile)
+ item->link = estrdup(fields[FieldLink]);
parsedtime = 0;
if (!strtotime(fields[FieldUnixTimestamp], &parsedtime)) {
@@ -1343,7 +1344,7 @@ draw(void)
if (panes[PaneItems].nrows &&
(row = pane_row_get(&panes[PaneItems], panes[PaneItems].pos))) {
item = (struct item *)row->data;
- statusbar_update(&statusbar, item->link);
+ statusbar_update(&statusbar, item->fields[FieldLink]);
} else {
statusbar_update(&statusbar, "");
}
@@ -1896,7 +1897,7 @@ nextpage:
row = pane_row_get(p, p->pos);
item = (struct item *)row->data;
markread(p, p->pos, p->pos, 1);
- plumb(plumber, item->link);
+ plumb(plumber, item->fields[FieldLink]);
}
break;
case 'c': /* items: pipe TSV line to program */