Skip to content

bufferoutputstream: fix newline detection fallback value

When running the tests under Windows10 + msys2, this check failed (expected CRLF, got LF):

test_empty (void)
{
        test_consecutive_write ("", "", 10, GTK_SOURCE_NEWLINE_TYPE_DEFAULT);
        ...

It's because gtk_text_iter_get_char() returns zero when no newline is present in the buffer, so get_newline_type() enters the "else return LF" condition.

I fixed the code to return the DEFAULT newline type in this case, but then another testcase with no newline in buffer failed (expected LF, got DEFAULT=CRLF) so I changed the expected value accordingly.

Merge request reports