From 324ac587362681b677daae118b1724cf5effde39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacobo=20Tarr=C3=ADo?= Date: Fri, 6 Oct 2000 22:04:07 +0000 Subject: [PATCH] Make GoldED+ behave well with DST. Change in CfgFormat patch. --- GNUmakef.inc | 6 +++--- docs/notework.txt | 3 +++ golded3/geline.cpp | 4 +++- golded3/gepost.cpp | 8 ++++++-- golded3/geqwks.cpp | 8 ++++++-- golded3/geread.cpp | 4 +++- golded3/gesoup.cpp | 8 ++++++-- golded3/geusrbse.cpp | 4 +++- 8 files changed, 33 insertions(+), 12 deletions(-) diff --git a/GNUmakef.inc b/GNUmakef.inc index 2d47c35..205a7b4 100644 --- a/GNUmakef.inc +++ b/GNUmakef.inc @@ -6,12 +6,12 @@ all: $(TARGET) include $(TOP)/GNUmakef.def -# Config files formats -include $(TOP)/Config.def - # Messagebase formats include $(TOP)/MSGBase.def +# Config files formats +include $(TOP)/Config.def + FOBJPATH=$(TOP)/$(OBJPATH)/$(PLATFORM)/$(TARGET) FLIBPATH=$(TOP)/$(LIBPATH)/$(PLATFORM) FDEPPATH=$(TOP)/$(DEPPATH)/$(PLATFORM) diff --git a/docs/notework.txt b/docs/notework.txt index bd1bac6..1dda2a3 100644 --- a/docs/notework.txt +++ b/docs/notework.txt @@ -15,6 +15,9 @@ ______________________________________________________________________ - Fixed Bug #109368: Ged+ crashes if there are more than 30 links in the help. Now accepts up to 50, and ignores more. +- Fixed bug that made GoldED+ not behave well with daylight savings + time (it showed an hour less). + ______________________________________________________________________ Notes for GoldED+ 1.1.4.6, August 7 2000 diff --git a/golded3/geline.cpp b/golded3/geline.cpp index 79b23f2..f5c7e4a 100644 --- a/golded3/geline.cpp +++ b/golded3/geline.cpp @@ -744,7 +744,9 @@ void KludgeDATE(GMsg* msg, const char* ptr) { t.tm_sec = second; t.tm_isdst = -1; time_t a = mktime(&t); - time_t b = mktime(gmtime(&a)); + struct tm *tp = gmtime(&a); + tp->tm_isdst = -1; + time_t b = mktime(tp); msg->written = a + a - b; } } diff --git a/golded3/gepost.cpp b/golded3/gepost.cpp index 899353f..1f5fa2d 100644 --- a/golded3/gepost.cpp +++ b/golded3/gepost.cpp @@ -223,7 +223,9 @@ static void MakeMsg3(int& mode, GMsg* msg) { // Do Timefields if(msg->attr.fmu()) { time_t a = time(NULL); - time_t b = mktime(gmtime(&a)); + struct tm *tp = gmtime(&a); + tp->tm_isdst = -1; + time_t b = mktime(tp); a += a - b; if(AA->isjam() or AA->iswildcat()) msg->received = a; @@ -792,7 +794,9 @@ void MakeMsg(int mode, GMsg* omsg) { } if(dochgdate) { time_t a = time(NULL); - time_t b = mktime(gmtime(&a)); + struct tm *tp = gmtime(&a); + tp->tm_isdst = -1; + time_t b = mktime(tp); a += a - b; msg->received = msg->arrived = msg->written = a; } diff --git a/golded3/geqwks.cpp b/golded3/geqwks.cpp index b41a13e..fd6dec9 100644 --- a/golded3/geqwks.cpp +++ b/golded3/geqwks.cpp @@ -209,10 +209,14 @@ int ImportQWK() { _tm.tm_sec = 0; _tm.tm_isdst = -1; time_t a = mktime(&_tm); - time_t b = mktime(gmtime(&a)); + struct tm *tp = gmtime(&a); + tp->tm_isdst = -1; + time_t b = mktime(tp); msg->written = a + a - b; a = time(NULL); - b = mktime(gmtime(&a)); + tp = gmtime(&a); + tp->tm_isdst = -1; + b = mktime(tp); msg->arrived = a + a - b; // Read message text diff --git a/golded3/geread.cpp b/golded3/geread.cpp index b87002f..de4ddc5 100644 --- a/golded3/geread.cpp +++ b/golded3/geread.cpp @@ -908,7 +908,9 @@ int LoadMessage(GMsg* msg, int margin) { reader_rcv_noise = 1; if(not msg->attr.rcv()) { // Have we seen it? time_t a = time(NULL); - time_t b = mktime(gmtime(&a)); + struct tm *tp = gmtime(&a); + tp->tm_isdst = -1; + time_t b = mktime(tp); msg->received = a + a - b; // Get current date msg->attr.rcv1(); // Mark as received reader_rcv_noise++; diff --git a/golded3/gesoup.cpp b/golded3/gesoup.cpp index bb08f44..f651034 100644 --- a/golded3/gesoup.cpp +++ b/golded3/gesoup.cpp @@ -168,7 +168,9 @@ void ProcessSoupMsg(char* lbuf, GMsg* msg, int& msgs, char* areaname, int tossto msg->orig = msg->oorig = CFG->internetgate.addr.net ? CFG->internetgate.addr : AA->aka(); msg->dest = msg->odest = AA->aka(); time_t a = time(NULL); - time_t b = mktime(gmtime(&a)); + struct tm *tp = gmtime(&a); + tp->tm_isdst = -1; + time_t b = mktime(tp); msg->arrived = a + a - b; Line* line = NULL; @@ -690,7 +692,9 @@ int ExportSoupMsg(GMsg* msg, char* msgfile, gfile& fp, int ismail) { msg->attr.scn1(); msg->attr.uns0(); time_t a = time(NULL); - time_t b = mktime(gmtime(&a)); + struct tm *tp = gmtime(&a); + tp->tm_isdst = -1; + time_t b = mktime(tp); msg->arrived = a + a - b; AA->SaveHdr(GMSG_UPDATE, msg); if(msg->attr.k_s()) diff --git a/golded3/geusrbse.cpp b/golded3/geusrbse.cpp index f608023..588fc53 100644 --- a/golded3/geusrbse.cpp +++ b/golded3/geusrbse.cpp @@ -442,7 +442,9 @@ void guserbase::write_entry(uint idx, bool updateit) { if(updateit and not entry.is_deleted) { time_t a = time(NULL); - time_t b = mktime(gmtime(&a)); + struct tm *tp = gmtime(&a); + tp->tm_isdst = -1; + time_t b = mktime(tp); entry.lastdate = a + a - b; if(not entry.firstdate) entry.firstdate = entry.lastdate;