I'm not sure it is even correct to unconditionally make line `""`. As a matter of fact, the best you could do here is probably leave line "as-is", (whatever `file.readln(line, terminator);` returns). From there, it's a matter of making sure `file.readln` *itself* returns null on past the end read, but `""` if it reaches a final trailing line.