lib/pager.c: In function ‘pager_preexec’:
lib/pager.c:148:12: warning: passing argument 2 to restrict-qualified parameter aliases with argument 4 [-Wrestrict]
Signed-off-by: Karel Zak <kzak@redhat.com>
for example:
# PAGER=foo dmesg -H
sh: foo: command not found
the same problem is we have with fdisk 'l' command:
# PAGER=foo fdisk /dev/sda
Welcome to fdisk (util-linux 2.30-rc2-33-41b71).
...
Command (m for help): l
sh: foo: command not found
It seems better to don't use pager at all if not available.
Signed-off-by: Karel Zak <kzak@redhat.com>
* clean up function names
* add functions to temporary redirect to the pager and then restore
original terminal output
Signed-off-by: Karel Zak <kzak@redhat.com>
Add missing function prototype, and declare structure before use of it.
lib/pager.c:162:6: warning: no previous prototype for function 'setup_pager' [-Wmissing-prototypes]
lib/pager.c:20:29: warning: tentative definition of variable with internal linkage has incomplete non-array type 'struct child_process' [-Wtentative-definition-incomplete-type]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
When some program' output exceeds the terminal's dimensions, it is a nice
feature to call a pager that acts as calling 'less' to allow better user
navigation. This patch adds this functionality, based on what perf and git
have (ie: git log).
Signed-off-by: Davidlohr Bueso <dave@gnu.org>