diff --git a/goldlib/gcfg/gedacfg.h b/goldlib/gcfg/gedacfg.h index 114161e..01718cb 100644 --- a/goldlib/gcfg/gedacfg.h +++ b/goldlib/gcfg/gedacfg.h @@ -227,6 +227,7 @@ protected: #if !defined(GCFG_NOCMAIL) || !defined(GCFG_NOCECHO) // Crashmail II parser function bool jbstrcpy(char *dest, char *src, size_t maxlen, size_t *jbc); + void ReadCrashmailCfg(const char* file); #endif #ifndef GCFG_NOTIMED // Timed parser function diff --git a/goldlib/gcfg/gxcrash.cpp b/goldlib/gcfg/gxcrash.cpp index c8b3f15..e9329d3 100644 --- a/goldlib/gcfg/gxcrash.cpp +++ b/goldlib/gcfg/gxcrash.cpp @@ -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) -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); +void gareafile::ReadCrashmailCfg(const char* file) { FILE* fp = fsopen(file, "rb", sharemode); if(fp) { @@ -101,6 +85,7 @@ void gareafile::ReadCrashmail(char* tag) { char buf[4000]; char key[30]; char tmp[100], address[50], domain[50]; + Path path; bool unconfirmed = true; size_t jbcpos; AreaCfg aa; @@ -151,8 +136,8 @@ void gareafile::ReadCrashmail(char* tag) { break; #ifndef GCFG_NOCECHO case CRC_AREAFILE: - jbstrcpy(tmp, buf, 100, &jbcpos); - ReadCrashmail(tmp); + jbstrcpy(path, buf, sizeof(Path), &jbcpos); + ReadCrashmail(path); break; case CRC_NETMAILDIR: 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); +} + + // ------------------------------------------------------------------