home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume6 / less.patch / pager_patch.c < prev    next >
Encoding:
C/C++ Source or Header  |  1986-11-30  |  935 b   |  29 lines

  1. /*
  2.  * Special interface that checks for the environment variable PAGER.  If
  3.  * present, the program specified is executed, otherwise OLD_PAGER_NEW_LOCATION
  4.  * (specified below).  This program should replace /usr/ucb/more (or whatever
  5.  * your default pager is) and more should be moved to OLD_PAGER_NEW_LOCATION.
  6.  * This is essentially a fix for all the programs which *should* check for the
  7.  * environment variable PAGER, but don't - hopefully it will be obsoleted as
  8.  * old programs are update to check for PAGER so we can loose the overhead of
  9.  * reexecuting even this small program ...
  10.  *
  11.  * Casey Leedom (lll-crg.arpa!csustan!casey) - 5/29/86
  12.  */
  13.  
  14. #ifndef OLD_PAGER_NEW_LOCATION
  15. #    define    OLD_PAGER_NEW_LOCATION    "/usr/ucb/More"
  16. #endif !OLD_PAGER_NEW_LOCATION
  17.  
  18. void
  19. main(argc, argv)
  20.     int    argc;
  21.     char    **argv;
  22. {
  23.     char    *pager, *getenv();
  24.  
  25.     if (!(pager = getenv("PAGER")))
  26.         pager = OLD_PAGER_NEW_LOCATION;
  27.     (void) execv(pager, argv);
  28. }
  29.