Fix parsing of @{-1}@{1}
[gitweb.git] / pager.c
diff --git a/pager.c b/pager.c
index aa0966c9c55566382bf32c946c0a1846f004125a..f19ddbc87df04f117cd5e39189c8322fd5f29d68 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -70,7 +70,8 @@ void setup_pager(void)
 
        /* original process continues, but writes to the pipe */
        dup2(pager_process.in, 1);
-       dup2(pager_process.in, 2);
+       if (isatty(2))
+               dup2(pager_process.in, 2);
        close(pager_process.in);
 
        /* this makes sure that the parent terminates after the pager */