Do not fork PAGER=cat
authorJunio C Hamano <junkio@cox.net>
Sun, 16 Apr 2006 08:46:08 +0000 (01:46 -0700)
committerJunio C Hamano <junkio@cox.net>
Sun, 16 Apr 2006 08:46:08 +0000 (01:46 -0700)
Unless the user has a nonstandard "cat" command that does not
meow like a cat, this should not break anything and would save an
extra pipe.

Signed-off-by: Junio C Hamano <junkio@cox.net>
pager.c

diff --git a/pager.c b/pager.c
index e5ba273..b063353 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -20,7 +20,7 @@ void setup_pager(void)
                return;
        if (!pager)
                pager = "less";
-       else if (!*pager)
+       else if (!*pager || !strcmp(pager, "cat"))
                return;
 
        if (pipe(fd) < 0)