Two small bugs in config parsers fixed.

This commit is contained in:
Alexander S. Aganichev 2000-05-25 05:24:33 +00:00
parent 8821a1698f
commit 7de851a3c0
3 changed files with 14 additions and 4 deletions

View File

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

View File

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

View File

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