]> git.ipfire.org Git - thirdparty/util-linux.git/commit
more: make sure we have data on stderr
authorKarel Zak <kzak@redhat.com>
Thu, 22 Aug 2024 06:56:52 +0000 (08:56 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 22 Aug 2024 07:05:09 +0000 (09:05 +0200)
commit640b9480bd3efc0f4bc7f38a785d02cda70ec5c3
tree9f9f21c812035cef4f0eafddc69e9e1ffffafd5d
parent96ac92a3d2734f70562f210564f5c3dde60f722a
more: make sure we have data on stderr

more(1) uses more_poll() to monitor data on stdin, stderr, and
signals. It is used before read_command(), but this function only
reads from stderr. Therefore, if any other non-stderr event occurs,
this function will wait on read(). In this case, more(1) will not
react to signals anymore. We need to ensure that more(1) only waits in
more_poll().

Try

 for x in {1..1000}; do echo "line $x"; done | more

to reproduce.

Reported-by: Radka Skvarilova <rskvaril@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
text-utils/more.c