diff options
author | Karel Zak <kzak@redhat.com> | 2024-04-15 09:07:41 +0200 |
---|---|---|
committer | Karel Zak <kzak@redhat.com> | 2024-04-15 09:07:41 +0200 |
commit | 1dca39791c0cd7c2f7886e970d7c5e00e5f72ece (patch) | |
tree | 5acafb4f0d28fd556a50f98d28f1442aa5842372 | |
parent | 01fb5ecefa4651bf3201889efb1118a6abc40d19 (diff) | |
parent | 966cb1382b59a9c1d5735b47aba27050c6d5c7e5 (diff) | |
download | util-linux-1dca39791c0cd7c2f7886e970d7c5e00e5f72ece.tar.gz |
Merge branch 'pager/less-quirk' of https://github.com/t-8ch/util-linux
* 'pager/less-quirk' of https://github.com/t-8ch/util-linux:
Revert "lib/pager: Apply pager-specific fixes only when needed"
-rw-r--r-- | lib/pager.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/pager.c b/lib/pager.c index 14bf071dbe..15a5e2736f 100644 --- a/lib/pager.c +++ b/lib/pager.c @@ -85,9 +85,7 @@ static int start_command(struct child_process *cmd) close(cmd->in); } - if (cmd->preexec_cb) - cmd->preexec_cb(); - + cmd->preexec_cb(); execvp(cmd->argv[0], (char *const*) cmd->argv); errexec(cmd->argv[0]); } @@ -142,7 +140,7 @@ static int finish_command(struct child_process *cmd) return wait_or_whine(cmd->pid); } -static void pager_preexec_less(void) +static void pager_preexec(void) { /* * Work around bug in "less" by not starting it until we @@ -243,11 +241,7 @@ static void __setup_pager(void) pager_argv[2] = pager; pager_process.argv = pager_argv; pager_process.in = -1; - - if (!strncmp(pager, "less", 4)) - pager_process.preexec_cb = pager_preexec_less; - else - pager_process.preexec_cb = NULL; + pager_process.preexec_cb = pager_preexec; if (start_command(&pager_process)) return; |