summaryrefslogtreecommitdiff
path: root/sfeed_gopher.c
diff options
context:
space:
mode:
Diffstat (limited to 'sfeed_gopher.c')
-rw-r--r--sfeed_gopher.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/sfeed_gopher.c b/sfeed_gopher.c
index f62c6ed..007a244 100644
--- a/sfeed_gopher.c
+++ b/sfeed_gopher.c
@@ -122,8 +122,9 @@ int
main(int argc, char *argv[])
{
FILE *fpitems, *fpindex, *fp;
- char *name, *p;
+ char *name, *p, *tmp, *endptr;
int i;
+ long l;
if (argc == 1) {
if (pledge("stdio", NULL) == -1)
@@ -139,8 +140,16 @@ main(int argc, char *argv[])
if ((comparetime = time(NULL)) == (time_t)-1)
errx(1, "time");
- /* 1 day is old news */
- comparetime -= 86400;
+
+ if ((tmp = getenv("SFEED_NEW_MAX_SECS"))) {
+ l = strtol(tmp, &endptr, 10);
+ if (*tmp == '\0' || *endptr != '\0' || l <= 0)
+ err(1, "cannot parse $SFEED_NEW_MAX_SECS");
+ comparetime -= l;
+ } else {
+ /* 1 day is old news */
+ comparetime -= 86400;
+ }
if ((p = getenv("SFEED_GOPHER_HOST")))
host = p;