Make GoldED+ behave well with DST. Change in CfgFormat patch.
This commit is contained in:
parent
324ac58736
commit
a139901f24
@ -428,6 +428,10 @@ char* strxmimecpy(char* dest, const char* source, int level, int size, bool dete
|
|||||||
if(need_reload) {
|
if(need_reload) {
|
||||||
table = LoadCharset(NULL, NULL, 1);
|
table = LoadCharset(NULL, NULL, 1);
|
||||||
level = LoadCharset(charset, CFG->xlatlocalset);
|
level = LoadCharset(charset, CFG->xlatlocalset);
|
||||||
|
if (!level) {
|
||||||
|
strcpy(charset, CFG->xlatimport);
|
||||||
|
level = LoadCharset(charset, CFG->xlatlocalset);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
XlatStr(buf, buf2, level, CharTable);
|
XlatStr(buf, buf2, level, CharTable);
|
||||||
|
@ -361,7 +361,9 @@ time_t FTimeToTime(FTime* __ftime, struct tm* __tm) {
|
|||||||
__tm->tm_isdst = -1;
|
__tm->tm_isdst = -1;
|
||||||
|
|
||||||
time_t a = mktime(__tm);
|
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;
|
_time = a + a - b;
|
||||||
|
|
||||||
if(_time == (ulong)0xFFFFFFFFL)
|
if(_time == (ulong)0xFFFFFFFFL)
|
||||||
@ -450,7 +452,9 @@ time_t FidoTimeToUnix(char* ptr) {
|
|||||||
t.tm_sec = second;
|
t.tm_sec = second;
|
||||||
t.tm_isdst = -1;
|
t.tm_isdst = -1;
|
||||||
time_t a = mktime(&t);
|
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 a + a - b;
|
||||||
}
|
}
|
||||||
return (ulong)-1;
|
return (ulong)-1;
|
||||||
|
@ -322,8 +322,8 @@ bool gareafile::ReadAreafile(word crc, char* parameters) {
|
|||||||
const word CRC_AREASBBS = 0xF77C;
|
const word CRC_AREASBBS = 0xF77C;
|
||||||
const word CRC_CRASHMAIL = 0x7551;
|
const word CRC_CRASHMAIL = 0x7551;
|
||||||
const word CRC_DBRIDGE = 0xD365;
|
const word CRC_DBRIDGE = 0xD365;
|
||||||
const word CRC_D_BRIDGE = 0x48DA;
|
|
||||||
const word CRC_DUTCHIE = 0x0B08;
|
const word CRC_DUTCHIE = 0x0B08;
|
||||||
|
const word CRC_D_BRIDGE = 0x48DA;
|
||||||
const word CRC_EZYCOM = 0xC81B;
|
const word CRC_EZYCOM = 0xC81B;
|
||||||
const word CRC_FASTECHO = 0xF2F0;
|
const word CRC_FASTECHO = 0xF2F0;
|
||||||
const word CRC_FE_ABS = 0x8007;
|
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_SQUISH = 0xFCF6;
|
||||||
const word CRC_SUPERBBS = 0x497F;
|
const word CRC_SUPERBBS = 0x497F;
|
||||||
const word CRC_TERMAIL = 0x147A;
|
const word CRC_TERMAIL = 0x147A;
|
||||||
const word CRC_TMAIL = 0xE837;
|
|
||||||
const word CRC_TIMED = 0xE977;
|
const word CRC_TIMED = 0xE977;
|
||||||
|
const word CRC_TMAIL = 0xE837;
|
||||||
const word CRC_TOSSCAN = 0x43DD;
|
const word CRC_TOSSCAN = 0x43DD;
|
||||||
const word CRC_WATERGATE = 0x3ADB;
|
const word CRC_WATERGATE = 0x3ADB;
|
||||||
const word CRC_WMAIL = 0xB167;
|
const word CRC_WMAIL = 0xB167;
|
||||||
@ -384,7 +384,7 @@ bool gareafile::ReadAreafile(word crc, char* parameters) {
|
|||||||
#ifndef GCFG_NOFIDOCONF
|
#ifndef GCFG_NOFIDOCONF
|
||||||
case CRC_FIDOCONFIG: ReadHPT(parameters); break;
|
case CRC_FIDOCONFIG: ReadHPT(parameters); break;
|
||||||
#endif
|
#endif
|
||||||
#ifndef GCFG_NOPCB
|
#ifndef GCFG_NOFIDOPCB
|
||||||
case CRC_FIDOPCB: ReadFidoPCB(parameters); break;
|
case CRC_FIDOPCB: ReadFidoPCB(parameters); break;
|
||||||
#endif
|
#endif
|
||||||
#ifndef GCFG_NOFMAIL
|
#ifndef GCFG_NOFMAIL
|
||||||
|
@ -221,16 +221,26 @@ protected:
|
|||||||
Path pathprefix;
|
Path pathprefix;
|
||||||
|
|
||||||
// Fidoconfig parser functions
|
// Fidoconfig parser functions
|
||||||
|
#ifndef GCFG_NOFIDOCONF
|
||||||
void replace_slashes(char **key);
|
void replace_slashes(char **key);
|
||||||
void gettok(char** key, char** val);
|
void gettok(char** key, char** val);
|
||||||
|
#endif
|
||||||
|
#ifndef GCFG_NOCMAIL
|
||||||
// Crashmail II parser function
|
// Crashmail II parser function
|
||||||
bool jbstrcpy(char *dest, char *src, size_t maxlen, size_t *jbc);
|
bool jbstrcpy(char *dest, char *src, size_t maxlen, size_t *jbc);
|
||||||
|
#endif
|
||||||
|
#ifndef GCFG_NOTIMED
|
||||||
// Timed parser function
|
// Timed parser function
|
||||||
void nullastbackslash(char* val);
|
void nullastbackslash(char* val);
|
||||||
|
#endif
|
||||||
|
#ifndef GCFG_NOWATERGATE
|
||||||
// Watergate parser function
|
// Watergate parser function
|
||||||
uint gettype(uint msgtype, const byte wtrtype);
|
uint gettype(uint msgtype, const byte wtrtype);
|
||||||
|
#endif
|
||||||
|
#ifndef GCFG_NOXMAIL
|
||||||
// XMail parser function
|
// XMail parser function
|
||||||
char* ClipDosFilename(char* __file);
|
char* ClipDosFilename(char* __file);
|
||||||
|
#endif
|
||||||
|
|
||||||
void adjustpath(char* path);
|
void adjustpath(char* path);
|
||||||
|
|
||||||
|
@ -92,7 +92,9 @@ int FidoArea::load_message(int __mode, gmsg* __msg, FidoHdr& __hdr) {
|
|||||||
}
|
}
|
||||||
__msg->written = __msg->written ? __msg->written : FidoTimeToUnix(__hdr.datetime);
|
__msg->written = __msg->written ? __msg->written : FidoTimeToUnix(__hdr.datetime);
|
||||||
time_t a = time(NULL);
|
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;
|
__msg->arrived = __msg->arrived ? __msg->arrived : a + a - b;
|
||||||
|
|
||||||
// Transfer attributes
|
// Transfer attributes
|
||||||
|
@ -135,7 +135,9 @@ int _HudsArea<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::load_message(in
|
|||||||
_tm.tm_sec = 0;
|
_tm.tm_sec = 0;
|
||||||
_tm.tm_isdst = -1;
|
_tm.tm_isdst = -1;
|
||||||
time_t a = mktime(&_tm);
|
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->written = a + a - b;
|
||||||
__msg->arrived = 0;
|
__msg->arrived = 0;
|
||||||
|
|
||||||
|
@ -142,7 +142,9 @@ void JamArea::open_area() {
|
|||||||
// Initialize header info
|
// Initialize header info
|
||||||
memcpy(data->hdrinfo.signature, JAM_SIGNATURE, 4);
|
memcpy(data->hdrinfo.signature, JAM_SIGNATURE, 4);
|
||||||
time_t a = time(NULL);
|
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.datecreated = a + a - b;
|
||||||
data->hdrinfo.passwordcrc = 0xFFFFFFFFL;
|
data->hdrinfo.passwordcrc = 0xFFFFFFFFL;
|
||||||
data->hdrinfo.basemsgnum = 1;
|
data->hdrinfo.basemsgnum = 1;
|
||||||
|
@ -80,7 +80,9 @@ int PcbArea::load_message(int __mode, gmsg* __msg, PcbHdr& __hdr) {
|
|||||||
_tm.tm_sec = 0;
|
_tm.tm_sec = 0;
|
||||||
_tm.tm_isdst = -1;
|
_tm.tm_isdst = -1;
|
||||||
time_t a = mktime(&_tm);
|
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->written = a + a - b;
|
||||||
__msg->arrived = 0;
|
__msg->arrived = 0;
|
||||||
|
|
||||||
|
@ -305,7 +305,9 @@ int SMBArea::load_hdr(gmsg* __msg, smbmsg_t *smsg)
|
|||||||
__msg->attr.tfs(smsgp->hdr.auxattr & MSG_TRUNCFILE);
|
__msg->attr.tfs(smsgp->hdr.auxattr & MSG_TRUNCFILE);
|
||||||
|
|
||||||
time_t a = smsgp->hdr.when_written.time;
|
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;
|
__msg->written = a + a - b;
|
||||||
a = smsgp->hdr.when_imported.time;
|
a = smsgp->hdr.when_imported.time;
|
||||||
b = mktime(gmtime(&a));
|
b = mktime(gmtime(&a));
|
||||||
@ -511,7 +513,9 @@ void SMBArea::save_hdr(int mode, gmsg* msg)
|
|||||||
else {
|
else {
|
||||||
memcpy(smsg.hdr.id, "SHD\x1a", 4);
|
memcpy(smsg.hdr.id, "SHD\x1a", 4);
|
||||||
smsg.hdr.version = SMB_VERSION;
|
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);
|
smsg.hdr.when_imported.time = time(NULL);
|
||||||
|
|
||||||
|
@ -104,7 +104,9 @@ int WCatArea::load_message(int __mode, gmsg* __msg, WCatHdr& __hdr) {
|
|||||||
_tm.tm_sec = _second;
|
_tm.tm_sec = _second;
|
||||||
_tm.tm_isdst = -1;
|
_tm.tm_isdst = -1;
|
||||||
time_t a = mktime(&_tm);
|
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->written = a + a - b;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,7 +124,9 @@ int WCatArea::load_message(int __mode, gmsg* __msg, WCatHdr& __hdr) {
|
|||||||
_tm.tm_sec = _second;
|
_tm.tm_sec = _second;
|
||||||
_tm.tm_isdst = -1;
|
_tm.tm_isdst = -1;
|
||||||
time_t a = mktime(&_tm);
|
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;
|
__msg->received = a + a - b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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_hour = t.tm_min = t.tm_sec = 0;
|
||||||
t.tm_isdst = -1;
|
t.tm_isdst = -1;
|
||||||
time_t a = mktime(&t);
|
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;
|
__msg->arrived = a + a - b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user