From a139901f247b9ec23f197a9883da33f09012d6bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacobo=20Tarr=C3=ADo?= Date: Fri, 6 Oct 2000 23:16:09 +0000 Subject: [PATCH] Make GoldED+ behave well with DST. Change in CfgFormat patch. --- golded3/geline.cpp | 4 ++++ goldlib/gall/gtimutil.cpp | 8 ++++++-- goldlib/gcfg/gedacfg.cpp | 6 +++--- goldlib/gcfg/gedacfg.h | 10 ++++++++++ goldlib/gmb3/gmofido3.cpp | 4 +++- goldlib/gmb3/gmohuds3.cpp | 4 +++- goldlib/gmb3/gmojamm2.cpp | 4 +++- goldlib/gmb3/gmopcbd3.cpp | 4 +++- goldlib/gmb3/gmosmb1.cpp | 8 ++++++-- goldlib/gmb3/gmowcat3.cpp | 8 ++++++-- goldlib/gmb3/gmoxbbs3.cpp | 4 +++- 11 files changed, 50 insertions(+), 14 deletions(-) diff --git a/golded3/geline.cpp b/golded3/geline.cpp index f5c7e4a..21656e8 100644 --- a/golded3/geline.cpp +++ b/golded3/geline.cpp @@ -428,6 +428,10 @@ char* strxmimecpy(char* dest, const char* source, int level, int size, bool dete if(need_reload) { table = LoadCharset(NULL, NULL, 1); level = LoadCharset(charset, CFG->xlatlocalset); + if (!level) { + strcpy(charset, CFG->xlatimport); + level = LoadCharset(charset, CFG->xlatlocalset); + } } XlatStr(buf, buf2, level, CharTable); diff --git a/goldlib/gall/gtimutil.cpp b/goldlib/gall/gtimutil.cpp index 9bf9dd9..02db08a 100644 --- a/goldlib/gall/gtimutil.cpp +++ b/goldlib/gall/gtimutil.cpp @@ -361,7 +361,9 @@ time_t FTimeToTime(FTime* __ftime, struct tm* __tm) { __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); _time = a + a - b; if(_time == (ulong)0xFFFFFFFFL) @@ -450,7 +452,9 @@ time_t FidoTimeToUnix(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); return a + a - b; } return (ulong)-1; diff --git a/goldlib/gcfg/gedacfg.cpp b/goldlib/gcfg/gedacfg.cpp index f4bf1ad..307571e 100644 --- a/goldlib/gcfg/gedacfg.cpp +++ b/goldlib/gcfg/gedacfg.cpp @@ -322,8 +322,8 @@ bool gareafile::ReadAreafile(word crc, char* parameters) { const word CRC_AREASBBS = 0xF77C; const word CRC_CRASHMAIL = 0x7551; const word CRC_DBRIDGE = 0xD365; - const word CRC_D_BRIDGE = 0x48DA; const word CRC_DUTCHIE = 0x0B08; + const word CRC_D_BRIDGE = 0x48DA; const word CRC_EZYCOM = 0xC81B; const word CRC_FASTECHO = 0xF2F0; const word CRC_FE_ABS = 0x8007; @@ -351,8 +351,8 @@ bool gareafile::ReadAreafile(word crc, char* parameters) { const word CRC_SQUISH = 0xFCF6; const word CRC_SUPERBBS = 0x497F; const word CRC_TERMAIL = 0x147A; - const word CRC_TMAIL = 0xE837; const word CRC_TIMED = 0xE977; + const word CRC_TMAIL = 0xE837; const word CRC_TOSSCAN = 0x43DD; const word CRC_WATERGATE = 0x3ADB; const word CRC_WMAIL = 0xB167; @@ -384,7 +384,7 @@ bool gareafile::ReadAreafile(word crc, char* parameters) { #ifndef GCFG_NOFIDOCONF case CRC_FIDOCONFIG: ReadHPT(parameters); break; #endif -#ifndef GCFG_NOPCB +#ifndef GCFG_NOFIDOPCB case CRC_FIDOPCB: ReadFidoPCB(parameters); break; #endif #ifndef GCFG_NOFMAIL diff --git a/goldlib/gcfg/gedacfg.h b/goldlib/gcfg/gedacfg.h index 68edc60..395cbdb 100644 --- a/goldlib/gcfg/gedacfg.h +++ b/goldlib/gcfg/gedacfg.h @@ -221,16 +221,26 @@ protected: Path pathprefix; // Fidoconfig parser functions +#ifndef GCFG_NOFIDOCONF void replace_slashes(char **key); void gettok(char** key, char** val); +#endif +#ifndef GCFG_NOCMAIL // Crashmail II parser function bool jbstrcpy(char *dest, char *src, size_t maxlen, size_t *jbc); +#endif +#ifndef GCFG_NOTIMED // Timed parser function void nullastbackslash(char* val); +#endif +#ifndef GCFG_NOWATERGATE // Watergate parser function uint gettype(uint msgtype, const byte wtrtype); +#endif +#ifndef GCFG_NOXMAIL // XMail parser function char* ClipDosFilename(char* __file); +#endif void adjustpath(char* path); diff --git a/goldlib/gmb3/gmofido3.cpp b/goldlib/gmb3/gmofido3.cpp index e35f117..bee36b8 100644 --- a/goldlib/gmb3/gmofido3.cpp +++ b/goldlib/gmb3/gmofido3.cpp @@ -92,7 +92,9 @@ int FidoArea::load_message(int __mode, gmsg* __msg, FidoHdr& __hdr) { } __msg->written = __msg->written ? __msg->written : FidoTimeToUnix(__hdr.datetime); 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 = __msg->arrived ? __msg->arrived : a + a - b; // Transfer attributes diff --git a/goldlib/gmb3/gmohuds3.cpp b/goldlib/gmb3/gmohuds3.cpp index 33c152e..6b1ee94 100644 --- a/goldlib/gmb3/gmohuds3.cpp +++ b/goldlib/gmb3/gmohuds3.cpp @@ -135,7 +135,9 @@ int _HudsArea::load_message(in _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; __msg->arrived = 0; diff --git a/goldlib/gmb3/gmojamm2.cpp b/goldlib/gmb3/gmojamm2.cpp index 9c8649a..523688d 100644 --- a/goldlib/gmb3/gmojamm2.cpp +++ b/goldlib/gmb3/gmojamm2.cpp @@ -142,7 +142,9 @@ void JamArea::open_area() { // Initialize header info memcpy(data->hdrinfo.signature, JAM_SIGNATURE, 4); 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); data->hdrinfo.datecreated = a + a - b; data->hdrinfo.passwordcrc = 0xFFFFFFFFL; data->hdrinfo.basemsgnum = 1; diff --git a/goldlib/gmb3/gmopcbd3.cpp b/goldlib/gmb3/gmopcbd3.cpp index e35f953..929cbe4 100644 --- a/goldlib/gmb3/gmopcbd3.cpp +++ b/goldlib/gmb3/gmopcbd3.cpp @@ -80,7 +80,9 @@ int PcbArea::load_message(int __mode, gmsg* __msg, PcbHdr& __hdr) { _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; __msg->arrived = 0; diff --git a/goldlib/gmb3/gmosmb1.cpp b/goldlib/gmb3/gmosmb1.cpp index 902e54c..eb372ab 100644 --- a/goldlib/gmb3/gmosmb1.cpp +++ b/goldlib/gmb3/gmosmb1.cpp @@ -305,7 +305,9 @@ int SMBArea::load_hdr(gmsg* __msg, smbmsg_t *smsg) __msg->attr.tfs(smsgp->hdr.auxattr & MSG_TRUNCFILE); time_t a = smsgp->hdr.when_written.time; - 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 = smsgp->hdr.when_imported.time; b = mktime(gmtime(&a)); @@ -511,7 +513,9 @@ void SMBArea::save_hdr(int mode, gmsg* msg) else { memcpy(smsg.hdr.id, "SHD\x1a", 4); smsg.hdr.version = SMB_VERSION; - smsg.hdr.when_written.time = mktime(gmtime(&msg->written)); + struct tm *tp = gmtime(&msg->written); + tp->tm_isdst = -1; + smsg.hdr.when_written.time = mktime(tp); } smsg.hdr.when_imported.time = time(NULL); diff --git a/goldlib/gmb3/gmowcat3.cpp b/goldlib/gmb3/gmowcat3.cpp index 2e1a40b..f0a895e 100644 --- a/goldlib/gmb3/gmowcat3.cpp +++ b/goldlib/gmb3/gmowcat3.cpp @@ -104,7 +104,9 @@ int WCatArea::load_message(int __mode, gmsg* __msg, WCatHdr& __hdr) { _tm.tm_sec = _second; _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; } @@ -122,7 +124,9 @@ int WCatArea::load_message(int __mode, gmsg* __msg, WCatHdr& __hdr) { _tm.tm_sec = _second; _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->received = a + a - b; } diff --git a/goldlib/gmb3/gmoxbbs3.cpp b/goldlib/gmb3/gmoxbbs3.cpp index 8cdf6b2..419a595 100644 --- a/goldlib/gmb3/gmoxbbs3.cpp +++ b/goldlib/gmb3/gmoxbbs3.cpp @@ -73,7 +73,9 @@ int XbbsArea::load_message(int __mode, gmsg* __msg, XbbsHdr& __hdr) { t.tm_hour = t.tm_min = t.tm_sec = 0; 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->arrived = a + a - b; }