| * This is split up from the rest of git so that we might do |
| * something different on Windows, for example. |
| static int spawned_pager; |
| static void run_pager(const char *pager) |
| * Work around bug in "less" by not starting it until we |
| select(1, &in, NULL, &in, NULL); |
| execlp(pager, pager, NULL); |
| execl("/bin/sh", "sh", "-c", pager, NULL); |
| const char *pager = getenv("GIT_PAGER"); |
| git_config(git_default_config); |
| else if (!*pager || !strcmp(pager, "cat")) |
| spawned_pager = 1; /* means we are emitting to terminal */ |
| /* return in the child */ |
| /* The original process turns into the PAGER */ |
| setenv("LESS", "FRSX", 0); |
| die("unable to execute pager '%s'", pager); |
| env = getenv("GIT_PAGER_IN_USE"); |
| return env ? git_config_bool("GIT_PAGER_IN_USE", env) : 0; |