From 82ff45a52146d690d02b5dc0b337652162f50c96 Mon Sep 17 00:00:00 2001 From: kichik Date: Fri, 25 Nov 2005 11:54:11 +0000 Subject: [PATCH] don't ignore multiple line comments inside ifdef'ed blocks git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4427 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/script.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Source/script.cpp b/Source/script.cpp index 8986142a..ec42fd98 100644 --- a/Source/script.cpp +++ b/Source/script.cpp @@ -262,9 +262,6 @@ int CEXEBuild::doParse(const char *str) while (*str == ' ' || *str == '\t') str++; - // if ignoring, ignore all lines that don't begin with !. - if (cur_ifblock && (cur_ifblock->ignore || cur_ifblock->inherited_ignore) && *str!='!' && !last_line_had_slash) return PS_OK; - if (m_linebuild.getlen()>1) m_linebuild.resize(m_linebuild.getlen()-2); m_linebuild.add(str,strlen(str)+1); @@ -282,6 +279,14 @@ int CEXEBuild::doParse(const char *str) m_linebuild.resize(0); + // if ignoring, ignore all lines that don't begin with an exclamation mark + { + bool ignore_line = cur_ifblock && (cur_ifblock->ignore || cur_ifblock->inherited_ignore); + char first_char = *(char *) m_linebuild.get(); + if (ignore_line && first_char!='!' && !last_line_had_slash) + return PS_OK; + } + if (res) { if (res==-2) ERROR_MSG("Error: unterminated string parsing line at %s:%d\n",curfilename,linecnt);