Random fixes

This commit is contained in:
Alexander S. Aganichev
2002-10-26 16:28:01 +00:00
parent 542867d190
commit 5c40b1a909
16 changed files with 85 additions and 33 deletions

View File

@@ -601,10 +601,7 @@ bool AreaList::GetAreaFirstPart(AreaCfg& aa, char*& key, char*& val) {
// Get group (letter)
getkeyval(&key, &val);
if(*key == '#')
aa.groupid = atoi(key+1)+0x8000u;
else
aa.groupid = (isupper(*key) ? *key : 0);
aa.groupid = getgroup(key);
// Get type
word crc = getkeyvalcrc(&key, &val);
@@ -931,10 +928,7 @@ void AreaList::GetAreaDesc(char* val) {
getkeyval(&key, &val);
if(*key) {
if(*key != '-') {
if(*key == '#')
aa->set_groupid(atoi(key+1)+0x8000u);
else
aa->set_groupid(toupper(*key));
aa->set_groupid(getgroup(key));
}
// Get aka (optional)

View File

@@ -35,6 +35,17 @@ extern char v7nodeflags[16][9];
extern char v7modemtype[8][9];
// ------------------------------------------------------------------
int getgroup(const char *key)
{
if(*key == '#')
return atoi(key+1)+0x8000u;
else
return (isupper(*key) ? *key : 0);
}
// ------------------------------------------------------------------
// Read GOLDED.CFG
@@ -156,19 +167,22 @@ void WriteGoldGed() {
// Check scan in/excludes
for(i = CFG->areascan.begin(); i != CFG->areascan.end(); i++) {
if(strwild((*AL.item)->echoid(), i->c_str())) {
const char *current = i->c_str();
if(((current[0] == '>') and ((*AL.item)->groupid() == getgroup(current+1))) or strwild((*AL.item)->echoid(), current)) {
(*AL.item)->set_scan(true);
break;
}
}
for(i = CFG->areascanexcl.begin(); i != CFG->areascanexcl.end(); i++) {
if(strwild((*AL.item)->echoid(), i->c_str())) {
const char *current = i->c_str();
if(((current[0] == '>') and ((*AL.item)->groupid() == getgroup(current+1))) or strwild((*AL.item)->echoid(), current)) {
(*AL.item)->set_scanexcl(true);
break;
}
}
for(i = CFG->areascanincl.begin(); i != CFG->areascanincl.end(); i++) {
if(strwild((*AL.item)->echoid(), i->c_str())) {
const char *current = i->c_str();
if(((current[0] == '>') and ((*AL.item)->groupid() == getgroup(current+1))) or strwild((*AL.item)->echoid(), current)) {
(*AL.item)->set_scanincl(true);
break;
}
@@ -176,19 +190,22 @@ void WriteGoldGed() {
// Check pmscan in/excludes
for(i = CFG->areapmscan.begin(); i != CFG->areapmscan.end(); i++) {
if(strwild((*AL.item)->echoid(), i->c_str())) {
const char *current = i->c_str();
if(((current[0] == '>') and ((*AL.item)->groupid() == getgroup(current+1))) or strwild((*AL.item)->echoid(), current)) {
(*AL.item)->set_pmscan(true);
break;
}
}
for(i = CFG->areapmscanexcl.begin(); i != CFG->areapmscanexcl.end(); i++) {
if(strwild((*AL.item)->echoid(), i->c_str())) {
const char *current = i->c_str();
if(((current[0] == '>') and ((*AL.item)->groupid() == getgroup(current+1))) or strwild((*AL.item)->echoid(), current)) {
(*AL.item)->set_pmscanexcl(true);
break;
}
}
for(i = CFG->areapmscanincl.begin(); i != CFG->areapmscanincl.end(); i++) {
if(strwild((*AL.item)->echoid(), i->c_str())) {
const char *current = i->c_str();
if(((current[0] == '>') and ((*AL.item)->groupid() == getgroup(current+1))) or strwild((*AL.item)->echoid(), current)) {
(*AL.item)->set_pmscanincl(true);
break;
}

View File

@@ -58,16 +58,33 @@ int AreaTypeOrder[17] = {
int compare_groups(int _ga, int _gb)
{
char *gap, *gbp;
register int ga = _ga ? _ga : INT_MAX;
register int gb = _gb ? _gb : INT_MAX;
if((ga > 0xff) || (gb > 0xff))
return compare_two(ga, gb);
const char *gap = NULL;
const char *gbp = NULL;
gap = strchr(CFG->arealistgrouporder, (char)ga);
gbp = strchr(CFG->arealistgrouporder, (char)gb);
const char *g;
for(g = CFG->arealistgrouporder; *g != NUL;) {
int gr = getgroup(g);
if(gr == ga)
gap = g;
if(gr == gb)
gbp = g;
if(*g == '#') {
do {
g++;
} while(isdigit(*g));
}
else
g++;
}
if(gap == NULL) {
if(gbp != NULL)
return 1;

View File

@@ -493,7 +493,9 @@ const char* Unpack(const char* archive) {
mkdir(newdir, S_IWUSR);
char cmdline[1024];
strxcpy(cmdline, i->second.c_str(), sizeof(cmdline));
strxcpy(newname, archive, sizeof(Path));
std::string archive_truename = archive;
maketruepath(archive_truename);
strxcpy(newname, archive_truename.c_str(), sizeof(Path));
strchg(newname, GOLD_WRONG_SLASH_CHR, GOLD_SLASH_CHR);
strischg(cmdline, "@file", newname);
// Store current drive/dir and change it to the temporary

View File

@@ -2140,12 +2140,16 @@ int IEclass::handlekey(gkey __key) {
case KK_EditDelChar:
case KK_EditDelLeft:
if(selecting) {
__key = KK_EditUndefine;
}
// fall through
case KK_EditPaste:
case KK_EditNewline:
if(selecting) {
BlockCut(true);
batch_mode = BATCH_MODE;
if(__key != KK_EditPaste)
__key = KK_EditUndefine;
}
goto noselecting;
break;

View File

@@ -55,6 +55,8 @@ void WriteGoldGed();
void InstallDetect(char* path);
int InstallFinish();
int getgroup(const char *key);
// ------------------------------------------------------------------
// GCKEYS prototypes

View File

@@ -83,7 +83,7 @@ bool edit_pathname(char* buf, int buf_size, char* title, int helpcat) {
// ------------------------------------------------------------------
int PopupLocked(long tries, int isopen, const char* file) {
bool PopupLocked(long tries, int isopen, const char* file) {
// Close popup window if requested
if(tries == 0) {