This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch master
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=7a6cdb430bd85bd38601730fef816e7c89e5e1b8

commit 7a6cdb430bd85bd38601730fef816e7c89e5e1b8
Author: Guillem Jover <[email protected]>
AuthorDate: Mon Aug 27 01:27:49 2018 +0200

    libdpkg: Require both stdin and stdout to be a tty to use a pager
    
    A pager requires both input being connected to a tty, and we want to use
    it when the output goes to the tty, so require both.
---
 debian/changelog | 2 ++
 lib/dpkg/pager.c | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index f8dc624ce..7bcfc04ae 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -81,6 +81,8 @@ dpkg (1.19.1) UNRELEASED; urgency=medium
   * Dump database package records in alphabetical order. This will give
     reproducible status and available database files, and make it possible
     to output other deb822 formatted data in a deterministic way.
+  * Require both standard input and output to be connected to a terminal to
+    use a pager.
   * Architecture support:
     - Add support for riscv64 CPU. Closes: #822914
       Thanks to Manuel A. Fernandez Montecelo <[email protected]>
diff --git a/lib/dpkg/pager.c b/lib/dpkg/pager.c
index a1cb10107..4922b537a 100644
--- a/lib/dpkg/pager.c
+++ b/lib/dpkg/pager.c
@@ -39,7 +39,7 @@ pager_get_exec(void)
 {
        const char *pager;
 
-       if (!isatty(1))
+       if (!isatty(0) || !isatty(1))
                return CAT;
 
        pager = getenv("PAGER");

-- 
Dpkg.Org's dpkg

Reply via email to