From 7de851a3c0b8ffe8e939606667ec36d5a6b439d2 Mon Sep 17 00:00:00 2001 From: "Alexander S. Aganichev" Date: Thu, 25 May 2000 05:24:33 +0000 Subject: [PATCH] Two small bugs in config parsers fixed. --- docs/notework.txt | 6 ++++++ goldlib/gcfg/gxcrash.cpp | 10 +++++++--- goldlib/gcfg/gxhpt.cpp | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/docs/notework.txt b/docs/notework.txt index 0d121b4..de92113 100644 --- a/docs/notework.txt +++ b/docs/notework.txt @@ -12,6 +12,12 @@ ______________________________________________________________________ Notes for GoldED+ 1.1.4.5, May XX 2000 ______________________________________________________________________ +- Fixed small bug in fidoconfig parser that brokes correct handling of + INCLUDE keyword. + +- Adjusted buffer size in Crashmail II parser, added LOCALAREA + recognition. + - EditExportText now saves whole the message to file, this is more predictable behaviour than before. diff --git a/goldlib/gcfg/gxcrash.cpp b/goldlib/gcfg/gxcrash.cpp index 35cf8c2..85c69c0 100644 --- a/goldlib/gcfg/gxcrash.cpp +++ b/goldlib/gcfg/gxcrash.cpp @@ -110,6 +110,7 @@ void gareafile::ReadCrashmail(char* tag) { const word CRC_AKA = 0x13A4; const word CRC_AREA = 0x010B; + const word CRC_LOCALAREA = 0xAEC1; const word CRC_DESCRIPTION = 0x2DF1; const word CRC_DOMAIN = 0xFFCA; const word CRC_GROUP = 0x1C9B; @@ -121,10 +122,12 @@ void gareafile::ReadCrashmail(char* tag) { const word CRC_JAM = 0xA8C3; const word CRC_SQUISH = 0xFCF6; - while(fgets(buf, 81, fp) != NULL) { + word crc16; + + while(fgets(buf, 4000, fp) != NULL) { jbcpos=0; jbstrcpy(key, buf, 30, &jbcpos); - switch(strCrc16(key)) { + switch(crc16 = strCrc16(key)) { case CRC_SYSOP: jbstrcpy(tmp, buf, 100, &jbcpos); CfgUsername(tmp); @@ -141,12 +144,13 @@ void gareafile::ReadCrashmail(char* tag) { break; case CRC_AREA: case CRC_NETMAIL: + case CRC_LOCALAREA: if(aa.type != 0xff) { if(not unconfirmed) AddNewArea(aa); aa.reset(); } - aa.type = (strCrc16(key) == CRC_NETMAIL) ? GMB_NET : GMB_ECHO; + aa.type = (crc16 == CRC_NETMAIL) ? GMB_NET : (crc16 == CRC_LOCALAREA) ? GMB_LOCAL : GMB_ECHO; switch(aa.type) { case GMB_NET: aa.attr = attribsnet; diff --git a/goldlib/gcfg/gxhpt.cpp b/goldlib/gcfg/gxhpt.cpp index 6c72dc1..557d5e3 100644 --- a/goldlib/gcfg/gxhpt.cpp +++ b/goldlib/gcfg/gxhpt.cpp @@ -120,7 +120,7 @@ bool gareafile::ReadHPTLine(FILE* f, string* s, bool add, int state) { ++ptr; } - if(not str.empty() and (*(str.end()-1) == '\n')) + while(not str.empty() and ((*(str.end()-1) == '\n') or (*(str.end()-1) == '\r'))) str.erase(str.end()-1); const char *p = strskip_wht(str.c_str());