version 1.1.1.1, 2008/08/28 13:17:41
|
version 1.1.1.1.2.2, 2008/09/30 20:00:26
|
Line 1
|
Line 1
|
|
/************************************************************************* |
|
* (C) 2008 AITNET ltd - Sofia/Bulgaria - <misho@aitbg.com> |
|
* by Michael Pounov <misho@openbsd-bg.org> |
|
* |
|
* $Author$ |
|
* $Id$ |
|
* |
|
*************************************************************************/ |
#include "global.h" |
#include "global.h" |
#include "aitcfg.h" |
#include "aitcfg.h" |
#include "tools.h" |
#include "tools.h" |
Line 55 int ReadConfig(FILE *f, sl_config * __restrict cfg)
|
Line 63 int ReadConfig(FILE *f, sl_config * __restrict cfg)
|
if (*szLine == '[') { |
if (*szLine == '[') { |
pos = strlen((char*) szLine) - 1; |
pos = strlen((char*) szLine) - 1; |
if (szLine[pos] != ']') { |
if (szLine[pos] != ']') { |
|
#ifdef __DEBUG |
cfgDbg(stdout, "WARNING:: Ignore section %s ... not closed breket\n", szLine); |
cfgDbg(stdout, "WARNING:: Ignore section %s ... not closed breket\n", szLine); |
|
#endif |
} else { |
} else { |
szLine[pos] = 0; |
szLine[pos] = 0; |
strncpy((char*) szSection, (char*) szLine + 1, MAX_STR); |
strncpy((char*) szSection, (char*) szLine + 1, MAX_STR); |
Line 69 int ReadConfig(FILE *f, sl_config * __restrict cfg)
|
Line 79 int ReadConfig(FILE *f, sl_config * __restrict cfg)
|
// Devide pairs |
// Devide pairs |
pos = strchr((char*) szLine, '=') ? strchr((char*) szLine, '=') - (char*) szLine : 0; |
pos = strchr((char*) szLine, '=') ? strchr((char*) szLine, '=') - (char*) szLine : 0; |
if (!pos) { |
if (!pos) { |
|
#ifdef __DEBUG |
cfgDbg(stdout, "WARNING:: Ignore a/v %s ... format error!\n", szLine); |
cfgDbg(stdout, "WARNING:: Ignore a/v %s ... format error!\n", szLine); |
|
#endif |
continue; |
continue; |
} else { |
} else { |
av = malloc(sizeof(struct tagPair)); |
av = malloc(sizeof(struct tagPair)); |