Fixed goldkeys.cfg parser

This commit is contained in:
Alexander S. Aganichev 2001-11-30 23:08:14 +00:00
parent 544d7b1f77
commit fe4a51f4ab
2 changed files with 18 additions and 3 deletions

View File

@ -12,6 +12,9 @@ ______________________________________________________________________
Notes for GoldED+ 1.1.5, /snapshot/ Notes for GoldED+ 1.1.5, /snapshot/
______________________________________________________________________ ______________________________________________________________________
- Fixed small bug in goldkeys.cfg parser so the last line without
the feed was incorrectly processed.
- Fixed pseudo in Internet areas. - Fixed pseudo in Internet areas.
- Partially fixed ATTRIBSEMAIL and ATTRIBSNEWS operation. They still - Partially fixed ATTRIBSEMAIL and ATTRIBSNEWS operation. They still

View File

@ -991,6 +991,12 @@ int ReadKeysCfg(int force) {
continue; continue;
ptr2 = ptr; ptr2 = ptr;
ptr = strskip_txt(ptr); ptr = strskip_txt(ptr);
if(*ptr == NUL) {
std::cout << "* " << cfgname << ": Incomplete line " << line << "." << std::endl;
SayBibi();
cfgerrors++;
continue;
}
*ptr++ = NUL; *ptr++ = NUL;
keycmd = SwitchKeyDefs(strCrc16(strupr(ptr2)), &keytype); keycmd = SwitchKeyDefs(strCrc16(strupr(ptr2)), &keytype);
if(keycmd) { if(keycmd) {
@ -1020,7 +1026,9 @@ int ReadKeysCfg(int force) {
ptr = strskip_wht(ptr); ptr = strskip_wht(ptr);
ptr2 = ptr; ptr2 = ptr;
ptr = strskip_txt(ptr); ptr = strskip_txt(ptr);
*ptr++ = 0; if(*ptr != NUL) {
*ptr++ = NUL;
}
keycmd = SwitchKeyDefs(strCrc16(strupr(ptr2)), &keytype); keycmd = SwitchKeyDefs(strCrc16(strupr(ptr2)), &keytype);
if(keycmd) { if(keycmd) {
if((keycmd >= KK_Macro) and (keycmd <= KK_ReadMacro)) { if((keycmd >= KK_Macro) and (keycmd <= KK_ReadMacro)) {
@ -1035,12 +1043,16 @@ int ReadKeysCfg(int force) {
ch = *ptr++; ch = *ptr++;
tmp2.buf[n++] = (gkey)(ch | (scancode(ch) << 8)); tmp2.buf[n++] = (gkey)(ch | (scancode(ch) << 8));
} }
*ptr++ = NUL; if(*ptr != NUL) {
*ptr++ = NUL;
}
} }
else { else {
ptr2 = ptr; ptr2 = ptr;
ptr = strskip_txt(ptr); ptr = strskip_txt(ptr);
*ptr++ = NUL; if(*ptr != NUL) {
*ptr++ = NUL;
}
int tmpkt; int tmpkt;
keycmd = SwitchKeyDefs(strCrc16(strupr(ptr2)), &tmpkt); keycmd = SwitchKeyDefs(strCrc16(strupr(ptr2)), &tmpkt);
if(keycmd) { if(keycmd) {