~ubuntu-branches/ubuntu/intrepid/git-core/intrepid-updates

« back to all changes in this revision

Viewing changes to pager.c

  • Committer: Package Import Robot
  • Author(s): Gerrit Pape
  • Date: 2007-04-22 13:31:05 UTC
  • mfrom: (1.1.14)
  • Revision ID: package-import@ubuntu.com-20070422133105-tkmhz328g2p0epz1
Tags: 1:1.5.1.2-1
* new upstream point release.
* debian/changelog.upstream: upstream changes taken from mailing list
  announcement.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#include "cache.h"
2
2
 
 
3
#include <sys/select.h>
 
4
 
3
5
/*
4
6
 * This is split up from the rest of git so that we might do
5
7
 * something different on Windows, for example.
7
9
 
8
10
static void run_pager(const char *pager)
9
11
{
 
12
        /*
 
13
         * Work around bug in "less" by not starting it until we
 
14
         * have real input
 
15
         */
 
16
        fd_set in;
 
17
 
 
18
        FD_ZERO(&in);
 
19
        FD_SET(0, &in);
 
20
        select(1, &in, NULL, &in, NULL);
 
21
 
10
22
        execlp(pager, pager, NULL);
11
23
        execl("/bin/sh", "sh", "-c", pager, NULL);
12
24
}