summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0dec30b)
raw | patch | inline | side by side (parent: 0dec30b)
author | Linus Torvalds <torvalds@osdl.org> | |
Fri, 21 Apr 2006 19:25:13 +0000 (12:25 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 21 Apr 2006 20:00:10 +0000 (13:00 -0700) |
When $PAGER is set to 'less -i', we used to fail because we
assumed the $PAGER is a command and simply exec'ed it.
Try exec first, and then run it through shell if it fails. This
allows even funkier PAGERs like these ;-):
PAGER='sed -e "s/^/`date`: /" | more'
PAGER='contrib/colordiff.perl | less -RS'
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
assumed the $PAGER is a command and simply exec'ed it.
Try exec first, and then run it through shell if it fails. This
allows even funkier PAGERs like these ;-):
PAGER='sed -e "s/^/`date`: /" | more'
PAGER='contrib/colordiff.perl | less -RS'
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
pager.c | patch | blob | history |
index e5ba2738b681387495b840d39dfeca920c865616..f7b8e78712bbce2d4915ee9ff8a72cfbbef008c5 100644 (file)
--- a/pager.c
+++ b/pager.c
static void run_pager(const char *pager)
{
execlp(pager, pager, NULL);
+ execl("/bin/sh", "sh", "-c", pager, NULL);
}
void setup_pager(void)
setenv("LESS", "-S", 0);
run_pager(pager);
+ die("unable to execute pager '%s'", pager);
exit(255);
}