sfeed_curses

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

commit 3b85ad87c74af82895b1f075dab87d1a42053568
parent 75ae09aea0ef7d60a69e59da0dc5ec1389f38c94
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Sat,  1 Aug 2020 14:01:15 +0200

sfeed_markread: return success also if an url is already marked read/unread

For example for items with duplicate urls that are marked already.  It will
still not update the other items though (except on reload).

This signals the interface to update the visual presentation for the current
item atleast.

It will needlessly move the data though in this exception case.

Diffstat:
Msfeed_markread | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sfeed_markread b/sfeed_markread @@ -16,8 +16,8 @@ unread) LC_CTYPE=C awk -F '\t' ' { FILENR += (FNR == 1) } FILENR == 1 { urls[$0] = 1 } - FILENR == 2 { if (urls[$0]) { changed = 1 } else { print $0 } } - END { exit(!changed) }' \ + FILENR == 2 { if (!urls[$0]) { print $0 } } + END { exit(FILENR != 2) }' \ "/dev/stdin" "$SFEED_URL_FILE" > "$tmp" && \ mv "$tmp" "$SFEED_URL_FILE" ;;