mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 13:13:44 +01:00
Merge remote-tracking branch 'ahf/bugs/21757'
This commit is contained in:
commit
10888dcac6
@ -5270,7 +5270,7 @@ tor_get_lines_from_handle, (int fd, enum stream_status *stream_status_out))
|
||||
goto done;
|
||||
|
||||
if (!lines) lines = smartlist_new();
|
||||
smartlist_add_strdup(lines, stdout_buf);
|
||||
smartlist_split_string(lines, stdout_buf, "\n", 0, 0);
|
||||
}
|
||||
|
||||
done:
|
||||
|
@ -4029,6 +4029,16 @@ test_util_string_from_pipe(void *ptr)
|
||||
tt_mem_op(buf, OP_EQ, "B\0\xff\xff", sizeof(buf));
|
||||
errno = 0;
|
||||
|
||||
/* Send in multiple lines. */
|
||||
retlen = write(test_pipe[1], "A\nB", 3);
|
||||
tt_int_op(retlen, OP_EQ, 3);
|
||||
|
||||
status = get_string_from_pipe(test_pipe[0], buf, sizeof(buf)-1);
|
||||
tt_int_op(errno, OP_EQ, 0);
|
||||
tt_int_op(status, OP_EQ, IO_STREAM_OKAY);
|
||||
tt_str_op(buf, OP_EQ, "A\nB");
|
||||
errno = 0;
|
||||
|
||||
/* Send in a line and close */
|
||||
retlen = write(test_pipe[1], "AB", 2);
|
||||
tt_int_op(retlen, OP_EQ, 2);
|
||||
|
Loading…
Reference in New Issue
Block a user