]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
debugfs: Don't use a pager if stdout is not a tty
authorTheodore Ts'o <tytso@mit.edu>
Thu, 20 Mar 2008 14:57:55 +0000 (10:57 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 20 Mar 2008 14:57:55 +0000 (10:57 -0400)
If we are redirecting the output of debugfs to a file or to another
process via a pipe, there's no point sending the output to a pager.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
debugfs/util.c

index a490d2cf2ab4b01a8a30b47fa545dbace90c65e3..06339601e694e97c7fb567c0ca728ee8b97fc6a7 100644 (file)
@@ -82,6 +82,8 @@ FILE *open_pager(void)
        char buf[80];
 
        signal(SIGPIPE, SIG_IGN);
+       if (!isatty(1))
+               return stdout;
        if (!pager)
                pager = getenv("PAGER");
        if (!pager)