Crashecho Areafile fixes

This commit is contained in:
Alexander S. Aganichev 2001-12-14 15:51:37 +00:00
parent d4d28f760b
commit eeb0fb8246
2 changed files with 30 additions and 19 deletions

View File

@ -227,6 +227,7 @@ protected:
#if !defined(GCFG_NOCMAIL) || !defined(GCFG_NOCECHO) #if !defined(GCFG_NOCMAIL) || !defined(GCFG_NOCECHO)
// Crashmail II parser function // Crashmail II parser function
bool jbstrcpy(char *dest, char *src, size_t maxlen, size_t *jbc); bool jbstrcpy(char *dest, char *src, size_t maxlen, size_t *jbc);
void ReadCrashmailCfg(const char* file);
#endif #endif
#ifndef GCFG_NOTIMED #ifndef GCFG_NOTIMED
// Timed parser function // Timed parser function

View File

@ -73,23 +73,7 @@ bool gareafile::jbstrcpy(char *dest, char *src, size_t maxlen, size_t *jbc) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
// Read areas from Crashmail II/CrashEcho (echomail processor) // Read areas from Crashmail II/CrashEcho (echomail processor)
void gareafile::ReadCrashmail(char* tag) { void gareafile::ReadCrashmailCfg(const char* file) {
Path file, path;
char options[80];
strcpy(options, tag);
char* ptr = strtok(tag, " \t");
while(ptr) {
if(*ptr != '-') {
strcpy(file, ptr);
}
ptr = strtok(NULL, " \t");
}
extractdirname(path, file);
CfgSquishuserpath(path);
FILE* fp = fsopen(file, "rb", sharemode); FILE* fp = fsopen(file, "rb", sharemode);
if(fp) { if(fp) {
@ -101,6 +85,7 @@ void gareafile::ReadCrashmail(char* tag) {
char buf[4000]; char buf[4000];
char key[30]; char key[30];
char tmp[100], address[50], domain[50]; char tmp[100], address[50], domain[50];
Path path;
bool unconfirmed = true; bool unconfirmed = true;
size_t jbcpos; size_t jbcpos;
AreaCfg aa; AreaCfg aa;
@ -151,8 +136,8 @@ void gareafile::ReadCrashmail(char* tag) {
break; break;
#ifndef GCFG_NOCECHO #ifndef GCFG_NOCECHO
case CRC_AREAFILE: case CRC_AREAFILE:
jbstrcpy(tmp, buf, 100, &jbcpos); jbstrcpy(path, buf, sizeof(Path), &jbcpos);
ReadCrashmail(tmp); ReadCrashmail(path);
break; break;
case CRC_NETMAILDIR: case CRC_NETMAILDIR:
if(aa.type != 0xff) { if(aa.type != 0xff) {
@ -250,4 +235,29 @@ void gareafile::ReadCrashmail(char* tag) {
} }
// ------------------------------------------------------------------
// Initialize parser
void gareafile::ReadCrashmail(char* tag) {
Path file, path;
char options[80];
strcpy(options, tag);
char* ptr = strtok(tag, " \t");
while(ptr) {
if(*ptr != '-') {
strcpy(file, ptr);
}
ptr = strtok(NULL, " \t");
}
extractdirname(path, file);
CfgSquishuserpath(path);
ReadCrashmailCfg(file);
}
// ------------------------------------------------------------------ // ------------------------------------------------------------------