X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=webcit%2Fsiteconfig.c;h=bdc3cc20576c288af5bf7d66b9aa481891f9ecf3;hp=2f3d91cb5dcfec2f6b4fd3a66bfad500b1e45a3f;hb=4b4dc864ede7c5d8d956febe4a0afb422b78e7c4;hpb=4119585313796eabb032cce61627ec95da60ac36 diff --git a/webcit/siteconfig.c b/webcit/siteconfig.c index 2f3d91cb5..bdc3cc205 100644 --- a/webcit/siteconfig.c +++ b/webcit/siteconfig.c @@ -209,6 +209,7 @@ CfgMapping ServerConfig[] = { }; + /* * display all configuration items */ @@ -218,7 +219,7 @@ void load_siteconfig(void) StrBuf *Buf; HashList *Cfg; long len; - int i; + int i, j; if (WCC->ServCfg == NULL) WCC->ServCfg = NewHash(1, NULL); @@ -233,40 +234,29 @@ void load_siteconfig(void) AppendImportantMessage(SKEY(Buf)); FreeStrBuf(&Buf); return; + } - - i = 0; + j = i = 0; while (len = StrBuf_ServGetln(Buf), - (len >= 0) - && (i < (sizeof(ServerConfig) / sizeof(CfgMapping))) - && ((len != 3) || strcmp(ChrPtr(Buf), "000")) - ) { - Put(Cfg, - ServerConfig[i].Key, - ServerConfig[i].len, - Buf, - HFreeStrBuf - ); - i++; - if (i <= sizeof(ServerConfig) / sizeof(CfgMapping)) { + (len >= 0) && + ((len != 3) || strcmp(ChrPtr(Buf), "000"))) + { + if (i < (sizeof(ServerConfig) / sizeof(CfgMapping))) + { + Put(Cfg, + ServerConfig[i].Key, + ServerConfig[i].len, + Buf, + HFreeStrBuf); + i++; Buf = NewStrBuf(); } else { - Buf = NULL; + if (j == 0) + AppendImportantMessage(_("WARNING: Failed to parse Server Config; do you run a to new citserver?"), -1); + j++; } } - - if (strcmp(ChrPtr(Buf), "000") != 0) - { - /* Discard config lines which we don't yet support */ - while ( (len = StrBuf_ServGetln(Buf), - strcmp(ChrPtr(Buf), "000")) - ) { - } - AppendImportantMessage(_("WARNING: Failed to parse Server Config; do you run a to new citserver?"), -1); - FreeStrBuf(&Buf); - return; - } FreeStrBuf(&Buf); LoadExpirePolicy(sitepolicy);