diff --git a/configure b/configure index c7cc17ad..ec665cf7 100755 --- a/configure +++ b/configure @@ -2309,7 +2309,7 @@ SUBDIRS="lib mbcico mbfido mbmon mbsebbs mbutils mbnntp mbtask mbsetup unix lang PACKAGE="mbsebbs" MAJOR="1" MINOR="0" -REVISION="6.13" +REVISION="6.14" VERSION="$MAJOR.$MINOR.$REVISION" COPYRIGHT="Copyright (C) 1997-2017 MBSE Development Team, All Rights Reserved" SHORTRIGHT="Copyright (C) 1997-2017 MBSE DevTm" diff --git a/configure.ac b/configure.ac index 06552002..06dc4d5c 100644 --- a/configure.ac +++ b/configure.ac @@ -12,7 +12,7 @@ AC_SUBST(SUBDIRS) PACKAGE="mbsebbs" MAJOR="1" MINOR="0" -REVISION="6.13" +REVISION="6.14" VERSION="$MAJOR.$MINOR.$REVISION" COPYRIGHT="Copyright (C) 1997-2017 MBSE Development Team, All Rights Reserved" SHORTRIGHT="Copyright (C) 1997-2017 MBSE DevTm" diff --git a/lib/users.h b/lib/users.h index 88ed9a05..f56af5f2 100644 --- a/lib/users.h +++ b/lib/users.h @@ -151,6 +151,7 @@ struct userrec { char Password[Max_passlen+1];/* Plain password */ int Charset; /* Character set */ int OLRext; /* OLR extension counter */ + time_t OLRlast; /* OLR last download */ }; diff --git a/mbsebbs/offline.c b/mbsebbs/offline.c index 27ed339e..40f30bbc 100644 --- a/mbsebbs/offline.c +++ b/mbsebbs/offline.c @@ -1160,8 +1160,8 @@ char *Extensions[] = { */ void OLR_DownBW() { - struct tm *tp; - time_t Now; + struct tm *tp, *tq; + time_t Now, Last; char Pktname[32], *Work, *Temp, *cwd = NULL, *p; int Area = 0; int RetVal = FALSE, rc = 0; @@ -1191,9 +1191,18 @@ void OLR_DownBW() Temp = calloc(PATH_MAX, sizeof(char)); Now = time(NULL); + Last = exitinfo.OLRlast; tp = localtime(&Now); + tq = localtime(&Last); + + /* Zero all fields except the dates */ + tq->tm_sec = tq->tm_min = tq->tm_hour = tq->tm_wday = tq->tm_yday = tq->tm_isdst = 0; + tp->tm_sec = tp->tm_min = tp->tm_hour = tp->tm_wday = tp->tm_yday = tp->tm_isdst = 0; + if ((mktime(tp)) != (mktime(tq))) { /* Last download wasn't today */ + exitinfo.OLRext = 0; + } + tp = localtime(&Now); Syslog('+', "Preparing Blue Wave packet"); - snprintf(Pktname, 32, "%s%s%d", CFG.bbsid , Extensions[tp->tm_wday], exitinfo.OLRext); Syslog('m', "Packet name %s", Pktname); snprintf(Work, PATH_MAX, "%s/%s/tmp", CFG.bbs_usersdir, exitinfo.Name); @@ -1420,6 +1429,7 @@ void OLR_DownBW() exitinfo.OLRext++; if (exitinfo.OLRext > 9) exitinfo.OLRext = 0; /* After 9, go back to 0 */ + exitinfo.OLRlast = Now; /* Save the last download date/time */ WriteExitinfo(); }