When working on a new bit of gcode, every now an then I get the message "program end or percentage sign missing" (M2) when loading the file in to linC.

But it isn't missing at all.

It seems to me that somehow it is overlooked but I do not understand why...

Today I got a new program working by copying the new code in to a bit of other code that did not give the error message.

Any idea as to why this happens?