# HG changeset patch # User Paul Boddie # Date 1717279178 -7200 # Node ID 617cfedf27be609df022159f4e04c4866a298c58 # Parent 475ab639418089455a493ac6e035d51675e734f6 Test end-of-file state on stdin to determine whether to close the input pipe. diff -r 475ab6394180 -r 617cfedf27be test_files/programs/test_popenv.c --- a/test_files/programs/test_popenv.c Sat Jun 01 23:58:28 2024 +0200 +++ b/test_files/programs/test_popenv.c Sat Jun 01 23:59:38 2024 +0200 @@ -141,7 +141,8 @@ /* If no input remains and stdin has been closed, close the input pipe. */ - if (!input_remaining && port_source_event_flags(port_file_source(fileno(stdin))) & PORT_CLOSE) + if (!input_remaining && (feof(stdin) || + port_source_event_flags(port_file_source(fileno(stdin))) & PORT_CLOSE)) { fclose(input); input = NULL;