mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-03 14:42:10 +01:00
Revert behaviour change in g_data_input_stream_read_line
svn path=/trunk/; revision=7720
This commit is contained in:
parent
52bfda3aea
commit
e959473234
@ -1,3 +1,9 @@
|
|||||||
|
2008-12-01 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* gdatainputstream.c (g_data_input_stream_read_line): Revert the
|
||||||
|
behaviour change, and update the docs instead, to avoid breaking
|
||||||
|
existing users.
|
||||||
|
|
||||||
2008-12-01 Matthias Clasen <mclasen@redhat.com>
|
2008-12-01 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* === Released 2.19.1 ===
|
* === Released 2.19.1 ===
|
||||||
|
@ -739,7 +739,7 @@ scan_for_newline (GDataInputStream *stream,
|
|||||||
* triggering the cancellable object from another thread. If the operation
|
* triggering the cancellable object from another thread. If the operation
|
||||||
* was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
|
* was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
|
||||||
*
|
*
|
||||||
* Returns: a string with the line that was read in (including the newlines).
|
* Returns: a string with the line that was read in (without the newlines).
|
||||||
* Set @length to a #gsize to get the length of the read line.
|
* Set @length to a #gsize to get the length of the read line.
|
||||||
* On an error, it will return %NULL and @error will be set. If there's no
|
* On an error, it will return %NULL and @error will be set. If there's no
|
||||||
* content to read, it will still return %NULL, but @error won't be set.
|
* content to read, it will still return %NULL, but @error won't be set.
|
||||||
@ -803,7 +803,7 @@ g_data_input_stream_read_line (GDataInputStream *stream,
|
|||||||
if (length)
|
if (length)
|
||||||
*length = (gsize)found_pos;
|
*length = (gsize)found_pos;
|
||||||
g_warn_if_fail (res == found_pos + newline_len);
|
g_warn_if_fail (res == found_pos + newline_len);
|
||||||
line[found_pos + newline_len] = 0;
|
line[found_pos] = 0;
|
||||||
|
|
||||||
return line;
|
return line;
|
||||||
}
|
}
|
||||||
|
@ -87,12 +87,8 @@ test_read_lines (GDataStreamNewlineType newline_type)
|
|||||||
data = g_data_input_stream_read_line (G_DATA_INPUT_STREAM (stream), &length, NULL, &error);
|
data = g_data_input_stream_read_line (G_DATA_INPUT_STREAM (stream), &length, NULL, &error);
|
||||||
if (data)
|
if (data)
|
||||||
{
|
{
|
||||||
char *expected;
|
g_assert_cmpstr (data, ==, lines[line]);
|
||||||
|
|
||||||
expected = g_strconcat (lines[line], endl[newline_type], NULL);
|
|
||||||
g_assert_cmpstr (data, ==, expected);
|
|
||||||
g_assert_no_error (error);
|
g_assert_no_error (error);
|
||||||
g_free (expected);
|
|
||||||
line++;
|
line++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user