diff --git a/src/ini_file_reader.c b/src/ini_file_reader.c index f363d1d9b3ad08a2c3a34cf4df576a6e86ca0304..9eaeeea0fd9895a1378e4b8817e9e3d0c62bfa06 100644 --- a/src/ini_file_reader.c +++ b/src/ini_file_reader.c @@ -336,6 +336,14 @@ static int iniDoLoadItemsFromBuffer(char *content, IniContext *pContext) *pLastEnd = '\0'; } + if (isAnnotation && pLine != pAnnoItemLine) + { + logWarning("file: "__FILE__", line: %d, " \ + "the @function and annotation item " \ + "must be next to each other", __LINE__); + isAnnotation = 0; + } + if (*pLine == '#' && \ strncasecmp(pLine+1, "include", 7) == 0 && \ (*(pLine+8) == ' ' || *(pLine+8) == '\t')) @@ -414,14 +422,6 @@ static int iniDoLoadItemsFromBuffer(char *content, IniContext *pContext) continue; } - if (isAnnotation && pLine != pAnnoItemLine) - { - logWarning("file: "__FILE__", line: %d, " \ - "the @function and annotation item " \ - "must be next to each other", __LINE__); - isAnnotation = 0; - } - trim(pLine); if (*pLine == '#' || *pLine == '\0') { @@ -607,6 +607,13 @@ static int iniDoLoadItemsFromBuffer(char *content, IniContext *pContext) pItem++; } + if (!result && isAnnotation) + { + logWarning("file: "__FILE__", line: %d, " \ + "the @function and annotation item " \ + "must be next to each other", __LINE__); + } + return result; }