Make GoldED+ behave well with DST. Change in CfgFormat patch.

This commit is contained in:
Jacobo Tarrío 2000-10-06 23:16:09 +00:00
parent 324ac58736
commit a139901f24
11 changed files with 50 additions and 14 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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

View File

@ -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);

View File

@ -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

View File

@ -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_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;

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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;
}

View File

@ -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;
}