`current_line` was incremented only when a read contained a newline, so `input_line_number` and error locations reported the previous line for a value whose line had not been terminated yet: the last line of input without a trailing newline, or a value ending exactly on the read-buffer boundary. Track whether the last read stopped short of a newline and add it to the reported line number.