mirror of
https://github.com/rkd77/elinks.git
synced 2025-02-02 15:09:23 -05:00
Allow empty /dev/stdin
For example: PAGER=elinks git diff shows nothing, when repo is not dirty.
This commit is contained in:
parent
a27e7d95ee
commit
cbf5ef6680
@ -207,6 +207,16 @@ list_directory(struct connection *conn, unsigned char *dirpath,
|
||||
return connection_state(S_OK);
|
||||
}
|
||||
|
||||
static void
|
||||
check_if_closed(struct socket *socket, struct read_buffer *rb)
|
||||
{
|
||||
if (socket->state == SOCKET_CLOSED) {
|
||||
abort_connection(socket->conn, connection_state(S_OK));
|
||||
return;
|
||||
}
|
||||
http_got_header(socket, rb);
|
||||
}
|
||||
|
||||
static void
|
||||
read_from_stdin(struct connection *conn)
|
||||
{
|
||||
@ -222,7 +232,7 @@ read_from_stdin(struct connection *conn)
|
||||
|
||||
conn->socket->state = SOCKET_END_ONCLOSE;
|
||||
read_from_socket(conn->socket, rb, connection_state(S_SENT),
|
||||
http_got_header);
|
||||
check_if_closed);
|
||||
}
|
||||
|
||||
/* To reduce redundant error handling code [calls to abort_connection()]
|
||||
|
Loading…
x
Reference in New Issue
Block a user