]> git.ipfire.org Git - thirdparty/util-linux.git/commit
lib/pager: don't use pager if command not available
authorKarel Zak <kzak@redhat.com>
Thu, 1 Jun 2017 12:20:20 +0000 (14:20 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 1 Jun 2017 12:20:20 +0000 (14:20 +0200)
commit535a4090b46395d86fa4a1bafb199e56c3968c95
treef23c01be403cdd8afb6c9f4fc786e0fa1ab9ea24
parent8ea1651c387d658ed5255b46d3813f8d73dd393b
lib/pager: don't use pager if command not available

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>
lib/pager.c