bSecRes
15th July 2003 19:24 UTC
Bug or am I insane?
I can't figure this one out at all. Please see the attached file. Ignore the random section stuff. There are two functions, getfilename and getfilenamebroke. The only difference is a comment line. But, one function works and the other is broke. I don't have any relative jumps using line numbers so it can't be that. It looks like the IntOp isn't finishing before the StrCpy (though how a comments slows that down I don't honestly know). When I check the stack and variables with Dumpstate::debug, the IntOp looks fine.
kichik
15th July 2003 19:27 UTC
As the last character of the line before the comment you've removed ends with a \ NSIS treats the next line as an extension of the line before the removed comment. So NSIS reads it like this:
IntOp $R1 $R1 + 1 ;account for StrCpy $R0 $R0 $R2 $R1
As you can see the StrCpy part is a part of the comment.
bSecRes
15th July 2003 20:04 UTC
Thanks Kichik I thought I was going insane. Of course I use \ everywhere but completely forgot about its significance because of the context and the context in which it was used. I also wouldn't have expected it to work on comment lines.
bSecRes
15th July 2003 20:07 UTC
HM NIS Edit also doesn't interpret this as a comment line, the color isn't the comment color gray. I'll E-mail that guy and let him know.
ranametal
19th July 2003 00:40 UTC
I forgot this NSIS feature when I wrote the highlighter, but I'm working in solve this.
BTW: The block comments have some issues, see this script:
OutFile TestComments.exe
Name "Test Comments"
Section
This text is ignored /* block comment begin here
some text to fill te comment
block comment end. */ MessageBox MB_OK "This line work fine"
SectionEnd