diff options
author | Matthias Lederhofer <matled@gmx.net> | 2006-07-31 15:27:00 +0200 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-07-31 15:51:25 -0700 |
commit | c27d205aaefb654c12a4ab9e0b4fae1882c0fc70 (patch) | |
tree | dd9a365a38adedb01e836585ce7a19376ae2d2d3 /pager.c | |
parent | aa086eb813d4fe21aac556a94efe5e29b44d8ca4 (diff) | |
download | git-c27d205aaefb654c12a4ab9e0b4fae1882c0fc70.tar.gz git-c27d205aaefb654c12a4ab9e0b4fae1882c0fc70.tar.xz |
pager: environment variable GIT_PAGER to override PAGER
Signed-off-by: Matthias Lederhofer <matled@gmx.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'pager.c')
-rw-r--r-- | pager.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -15,11 +15,13 @@ void setup_pager(void) { pid_t pid; int fd[2]; - const char *pager = getenv("PAGER"); + const char *pager = getenv("GIT_PAGER"); if (!isatty(1)) return; if (!pager) + pager = getenv("PAGER"); + if (!pager) pager = "less"; else if (!*pager || !strcmp(pager, "cat")) return; |