summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/pager.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/pager.c b/lib/pager.c
index 9740c711e..b3cf6ee79 100644
--- a/lib/pager.c
+++ b/lib/pager.c
@@ -141,11 +141,13 @@ static void pager_preexec(void)
* Work around bug in "less" by not starting it until we
* have real input
*/
- fd_set in;
+ fd_set in, ex;
FD_ZERO(&in);
FD_SET(STDIN_FILENO, &in);
- select(1, &in, NULL, &in, NULL);
+ ex = in;
+
+ select(STDIN_FILENO + 1, &in, NULL, &ex, NULL);
if (setenv("LESS", "FRSX", 0) != 0)
warn(_("failed to set the %s environment variable"), "LESS");