提交 d1026167 编写于 作者: L liuwei

eliminate potential trouble

上级 d3e8cc18
...@@ -336,6 +336,14 @@ static int iniDoLoadItemsFromBuffer(char *content, IniContext *pContext) ...@@ -336,6 +336,14 @@ static int iniDoLoadItemsFromBuffer(char *content, IniContext *pContext)
*pLastEnd = '\0'; *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 == '#' && \ if (*pLine == '#' && \
strncasecmp(pLine+1, "include", 7) == 0 && \ strncasecmp(pLine+1, "include", 7) == 0 && \
(*(pLine+8) == ' ' || *(pLine+8) == '\t')) (*(pLine+8) == ' ' || *(pLine+8) == '\t'))
...@@ -414,14 +422,6 @@ static int iniDoLoadItemsFromBuffer(char *content, IniContext *pContext) ...@@ -414,14 +422,6 @@ static int iniDoLoadItemsFromBuffer(char *content, IniContext *pContext)
continue; 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); trim(pLine);
if (*pLine == '#' || *pLine == '\0') if (*pLine == '#' || *pLine == '\0')
{ {
...@@ -607,6 +607,13 @@ static int iniDoLoadItemsFromBuffer(char *content, IniContext *pContext) ...@@ -607,6 +607,13 @@ static int iniDoLoadItemsFromBuffer(char *content, IniContext *pContext)
pItem++; pItem++;
} }
if (!result && isAnnotation)
{
logWarning("file: "__FILE__", line: %d, " \
"the @function and annotation item " \
"must be next to each other", __LINE__);
}
return result; return result;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册