nextc(): always return an '\n' at end of input

fix #1564