Do not consume the newline character explicitly.
On Windows a newline is denoted by CR+LF (or \r\n) so we miss out on one of these anyway. The newline character(s) will be consumed in the next iteration(s) of the outer loop.
Prevent an IndexOutOfBoundsException if the SQL-String ends with a single line comment without a newline.