From 177bd5183ab24c4226633f59d2403b876f3cb962 Mon Sep 17 00:00:00 2001 From: Stas Degteff Date: Tue, 22 Feb 2011 11:27:21 +0000 Subject: [PATCH] Fix soup & WQK operations on start --- golded3/gccfgg0.cpp | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/golded3/gccfgg0.cpp b/golded3/gccfgg0.cpp index 2bafde2..b67e17f 100644 --- a/golded3/gccfgg0.cpp +++ b/golded3/gccfgg0.cpp @@ -936,25 +936,28 @@ int ReadCfg(const char* cfgfile, int ignoreunknown) if (inuse == 0) { // Mark all areas listed in the NEWSRC file as newsgroups - gfile gfp(CFG->soupnewsrcfile, "rt"); - if (gfp.isopen()) + if (*CFG->soupnewsrcfile) { - char buf2[512]; - while (gfp.Fgets(buf2, sizeof(buf2))) + gfile gfp(CFG->soupnewsrcfile, "rt"); + if (gfp.isopen()) { - char* ptr = strpbrk(buf2, ":! "); - if(ptr) { - *ptr = NUL; - Area* ap = AL.AreaEchoToPtr(buf2); - if(ap) - ap->set_type(ap->isnet() ? GMB_SOUP|GMB_EMAIL|GMB_NET : GMB_SOUP|GMB_NEWSGROUP|GMB_ECHO); + char buf2[512]; + while (gfp.Fgets(buf2, sizeof(buf2))) + { + char* ptr = strpbrk(buf2, ":! "); + if(ptr) { + *ptr = NUL; + Area* ap = AL.AreaEchoToPtr(buf2); + if(ap) + ap->set_type(ap->isnet() ? GMB_SOUP|GMB_EMAIL|GMB_NET : GMB_SOUP|GMB_NEWSGROUP|GMB_ECHO); + } } + gfp.Fclose(); } - gfp.Fclose(); } if(*CFG->soupemail) { - Area* ap = AL.AreaEchoToPtr(buf); + Area* ap = AL.AreaEchoToPtr(CFG->soupemail); if(ap) ap->set_type(GMB_SOUP|GMB_EMAIL|GMB_NET); } @@ -971,7 +974,7 @@ int ReadCfg(const char* cfgfile, int ignoreunknown) do { if(QWK->FirstConf()) { do { - Area* ap = AL.AreaEchoToPtr(buf); + Area* ap = AL.AreaEchoToPtr(QWK->ConfName()); if(ap) ap->set_type(ap->type() | GMB_QWK); } while(QWK->NextConf());