implemented RFE #1686589 and fixed bug #1701051 - improve warning for backslash line end in comment

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5380 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2007-11-18 19:19:55 +00:00
parent d4f0469dbe
commit 63d000e9c5

View file

@ -285,16 +285,26 @@ int CEXEBuild::doParse(const char *str)
if (m_linebuild.getlen()>1)
m_linebuild.resize(m_linebuild.getlen()-2);
// warn of comment with line-continuation
if (m_linebuild.getlen())
{
LineParser prevline(inside_comment);
prevline.parse((char*)m_linebuild.get());
LineParser thisline(inside_comment);
thisline.parse((char*)str);
if (prevline.inComment() && !thisline.inComment())
{
warning_fl("comment contains line-continuation character, following line will be ignored");
}
}
// add new line to line buffer
m_linebuild.add(str,strlen(str)+1);
// keep waiting for more lines, if this line ends with a backslash
if (str[0] && CharPrev(str,str+strlen(str))[0] == '\\')
{
line.parse((char*)m_linebuild.get());
if (line.inComment())
{
warning_fl("comment contains line-continuation character, following line will be ignored");
}
return PS_OK;
}