home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / GNUMAN.ZIP / patches.os2 < prev    next >
Text File  |  1993-02-14  |  9KB  |  412 lines

  1. diff -cb orig/config.h new/config.h
  2. *** orig/config.h    Mon Oct 12 21:07:54 1992
  3. --- new/config.h    Mon Oct 12 20:27:50 1992
  4. ***************
  5. *** 17,27 ****
  6.    */
  7.   
  8.   #ifndef BUFSIZ
  9. ! #define BUFSIZ 1024
  10.   #endif
  11.   
  12.   #ifndef MAXPATHLEN
  13. ! #define MAXPATHLEN 512
  14.   #endif
  15.   
  16.   #ifndef MAXDIRS
  17. --- 17,27 ----
  18.    */
  19.   
  20.   #ifndef BUFSIZ
  21. ! #define BUFSIZ 5120
  22.   #endif
  23.   
  24.   #ifndef MAXPATHLEN
  25. ! #define MAXPATHLEN 254
  26.   #endif
  27.   
  28.   #ifndef MAXDIRS
  29. ***************
  30. *** 32,39 ****
  31.    * These are the programs man(1) execs with the -k and -f options.
  32.    */
  33.   
  34. ! #define APROPOS "/usr/local/bin/apropos"
  35. ! #define WHATIS  "/usr/local/bin/whatis"
  36.   
  37.   /*
  38.    * This might also be "/usr/ucb/more -s", though I prefer less(1)
  39. --- 32,39 ----
  40.    * These are the programs man(1) execs with the -k and -f options.
  41.    */
  42.   
  43. ! #define APROPOS "apropos"
  44. ! #define WHATIS  "whatis"
  45.   
  46.   /*
  47.    * This might also be "/usr/ucb/more -s", though I prefer less(1)
  48. ***************
  49. *** 40,60 ****
  50.    * because it allows one to backup even when reading from pipes.
  51.    */
  52.   
  53. ! #define PAGER   "/usr/local/bin/less -sC"
  54.   
  55. ! static char config_file[] = "/usr/local/lib/man/manpath.config";
  56.   
  57.   /*
  58.    * These might also be something like
  59.    *
  60. !  *  nroff_command[] = "/usr/local/bin/groff -Tascii -man"
  61. !  *  troff_command[] = "/usr/local/bin/groff -Tps -man"
  62.    */
  63.   
  64. ! static char nroff_command[] = "/usr/bin/nroff -man";
  65.   
  66.   #ifdef HAS_TROFF
  67. ! static char troff_command[] = "/usr/bin/troff -man";
  68.   #endif
  69.   
  70.   /*
  71. --- 40,60 ----
  72.    * because it allows one to backup even when reading from pipes.
  73.    */
  74.   
  75. ! #define PAGER   "less"
  76.   
  77. ! static char config_file[] = "manpath.cfg";
  78.   
  79.   /*
  80.    * These might also be something like
  81.    *
  82. !  *  nroff_command[] = "groff -man"
  83. !  *  troff_command[] = "groff -Tps -man"
  84.    */
  85.   
  86. ! static char nroff_command[] = "groff -man";
  87.   
  88.   #ifdef HAS_TROFF
  89. ! static char troff_command[] = "groff -Tps -man";
  90.   #endif
  91.   
  92.   /*
  93. diff -cb orig/gripes.c new/gripes.c
  94. *** orig/gripes.c    Mon Oct 12 21:07:54 1992
  95. --- new/gripes.c    Thu Sep 03 19:19:14 1992
  96. ***************
  97. *** 17,23 ****
  98.   #include <stdio.h>
  99.   #include "gripes.h"
  100.   
  101. ! #ifndef __STDH__
  102.   extern int fprintf ();
  103.   extern int fflush ();
  104.   extern int exit ();
  105. --- 17,23 ----
  106.   #include <stdio.h>
  107.   #include "gripes.h"
  108.   
  109. ! #ifndef STD_HEADERS
  110.   extern int fprintf ();
  111.   extern int fflush ();
  112.   extern int exit ();
  113. diff -cb orig/man.c new/man.c
  114. *** orig/man.c    Mon Oct 12 21:07:56 1992
  115. --- new/man.c    Mon Oct 12 21:06:24 1992
  116. ***************
  117. *** 227,233 ****
  118.       }
  119.       }
  120.   
  121. !   if (pager == NULL || *pager == NULL)
  122.       if ((pager = getenv ("PAGER")) == NULL)
  123.         pager = strdup (PAGER);
  124.   
  125. --- 227,233 ----
  126.       }
  127.       }
  128.   
  129. !   if (pager == NULL || *pager == 0)
  130.       if ((pager = getenv ("PAGER")) == NULL)
  131.         pager = strdup (PAGER);
  132.   
  133. ***************
  134. *** 253,258 ****
  135. --- 253,264 ----
  136.     downcase (alt_system_name);
  137.   #endif
  138.   
  139. + #ifdef __EMX__
  140. +   for (p = manp; *p; p++)
  141. +     if (*p == '\\')
  142. +       *p = '/';
  143. + #endif
  144.     /*
  145.      * Expand the manpath into a list for easier handling.
  146.      */
  147. ***************
  148. *** 259,265 ****
  149. --- 265,275 ----
  150.     mp = manpathlist;
  151.     for (p = manp ; ; p = end+1)
  152.       {
  153. + #ifdef __EMX__
  154. +       if ((end = strchr (p, ';')) != NULL)
  155. + #else
  156.         if ((end = strchr (p, ':')) != NULL)
  157. + #endif
  158.       *end = '\0';
  159.   
  160.         if (debug)
  161. ***************
  162. *** 354,360 ****
  163.     register char **vs;
  164.   
  165.     for (vs = valid_sections; *vs != NULL; vs++)
  166. !     if ((strcmp (*vs, name) == NULL) || (isdigit (name[0])))
  167.         return strdup (name);
  168.   
  169.     return NULL;
  170. --- 364,370 ----
  171.     register char **vs;
  172.   
  173.     for (vs = valid_sections; *vs != NULL; vs++)
  174. !     if ((strcmp (*vs, name) == 0) || (isdigit (name[0])))
  175.         return strdup (name);
  176.   
  177.     return NULL;
  178. ***************
  179. *** 597,603 ****
  180.     t1 = strrchr (to_name, '/');
  181.     if (t1 != NULL)
  182.       {
  183. !       *t1 = NULL;
  184.         t2 = strrchr (to_name, '/');
  185.         *t1 = '/';
  186.       }
  187. --- 607,613 ----
  188.     t1 = strrchr (to_name, '/');
  189.     if (t1 != NULL)
  190.       {
  191. !       *t1 = 0;
  192.         t2 = strrchr (to_name, '/');
  193.         *t1 = '/';
  194.       }
  195. ***************
  196. *** 720,726 ****
  197.   
  198.     found = 0;
  199.   
  200. !   if (access (file, R_OK) == NULL)
  201.       {
  202.         sprintf (command, "%s %s", pager, file);
  203.   
  204. --- 730,736 ----
  205.   
  206.     found = 0;
  207.   
  208. !   if (access (file, R_OK) == 0)
  209.       {
  210.         sprintf (command, "%s %s", pager, file);
  211.   
  212. ***************
  213. *** 830,844 ****
  214.     if (troff || !cat_support)
  215.       {
  216.         if (troff)
  217. !     sprintf (command, "(cd %s ; %s %s)", path, troff_command, man_file);
  218.         else
  219. !     sprintf (command, "(cd %s ; %s %s | %s)", path, nroff_command,
  220. !          man_file, pager);
  221.   #else
  222.     if (!cat_support)
  223.       {
  224. !       sprintf (command, "(cd %s ; %s %s | %s)", path, nroff_command,
  225. !            man_file, pager);
  226.   #endif
  227.         status = 0;
  228.         if (debug)
  229. --- 840,852 ----
  230.     if (troff || !cat_support)
  231.       {
  232.         if (troff)
  233. !     sprintf (command, "%s %s", troff_command, man_file);
  234.         else
  235. !     sprintf (command, "%s %s | %s", nroff_command, man_file, pager);
  236.   #else
  237.     if (!cat_support)
  238.       {
  239. !       sprintf (command, "%s %s | %s", nroff_command, man_file, pager);
  240.   #endif
  241.         status = 0;
  242.         if (debug)
  243. ***************
  244. *** 862,868 ****
  245.   
  246.             fprintf (stderr, "Formatting page, please wait...\n");
  247.   
  248. !           sprintf (command, "(cd %s ; %s %s > %s)", path,
  249.                  nroff_command, man_file, cat_file);
  250.   
  251.             signal (SIGINT, SIG_IGN);
  252. --- 870,885 ----
  253.   
  254.             fprintf (stderr, "Formatting page, please wait...\n");
  255.   
  256. ! #ifdef __EMX__
  257. !           {
  258. !         char *p;
  259. !         for (p = cat_file; *p; p++)
  260. !           if (*p == '/')
  261. !             *p = '\\';           /* some OS/2 shells die otherwise */
  262. !           }
  263. ! #endif
  264. !           sprintf (command, "%s %s > %s", 
  265.                  nroff_command, man_file, cat_file);
  266.   
  267.             signal (SIGINT, SIG_IGN);
  268. ***************
  269. *** 890,896 ****
  270.           }
  271.         else
  272.           {
  273. !           sprintf (command, "(cd %s ; %s %s | %s)", path, nroff_command,
  274.                  man_file, pager);
  275.   
  276.             status = 0;
  277. --- 907,913 ----
  278.           }
  279.         else
  280.           {
  281. !           sprintf (command, "%s %s | %s", nroff_command,
  282.                  man_file, pager);
  283.   
  284.             status = 0;
  285. diff -cb orig/manpath.c new/manpath.c
  286. *** orig/manpath.c    Mon Oct 12 21:07:56 1992
  287. --- new/manpath.c    Thu Sep 03 19:59:52 1992
  288. ***************
  289. *** 178,190 ****
  290.     int i;
  291.     char *bp;
  292.     char *p;
  293. !   char buf[BUFSIZ];
  294.     DIRLIST *dlp = list;
  295.     FILE *config;
  296.   
  297. !   if ((config = fopen (config_file, "r")) == NULL)
  298. !     gripe_getting_mp_config (config_file);
  299.   
  300.     while ((bp = fgets (buf, BUFSIZ, config)) != NULL)
  301.       {
  302.         while (*bp && (*bp == ' ' || *bp == '\t'))
  303. --- 178,198 ----
  304.     int i;
  305.     char *bp;
  306.     char *p;
  307. !   char buf[BUFSIZ], cfg_file[MAXPATHLEN];
  308.     DIRLIST *dlp = list;
  309.     FILE *config;
  310.   
  311. ! #ifdef __EMX__
  312. !   _searchenv(config_file, "INIT", cfg_file);
  313. !   if (cfg_file[0] == 0)
  314. !     _searchenv(config_file, "PATH", cfg_file);
  315. !   if (cfg_file[0] == 0)
  316. !     strcpy(cfg_file, config_file);
  317. ! #endif
  318.   
  319. +   if ((config = fopen (cfg_file, "r")) == NULL)
  320. +     gripe_getting_mp_config (cfg_file);
  321.     while ((bp = fgets (buf, BUFSIZ, config)) != NULL)
  322.       {
  323.         while (*bp && (*bp == ' ' || *bp == '\t'))
  324. ***************
  325. *** 255,262 ****
  326.         dlp++;
  327.       }
  328.   
  329. !   dlp->bin[0] = NULL;
  330. !   dlp->mandir[0] = NULL;
  331.     dlp->mandatory = 0;
  332.   
  333.     return 0;
  334. --- 263,270 ----
  335.         dlp++;
  336.       }
  337.   
  338. !   dlp->bin[0] = 0;
  339. !   dlp->mandir[0] = 0;
  340.     dlp->mandatory = 0;
  341.   
  342.     return 0;
  343. ***************
  344. *** 332,345 ****
  345.   
  346.     for (p = tmppath; ; p = end+1)
  347.       {
  348.         if (end = strchr(p, ':'))
  349.       *end = '\0';
  350.   
  351.         if (debug)
  352.       fprintf (stderr, "\npath directory %s ", p);
  353.   
  354. !       for (dlp = list; dlp->mandir[0] != NULL; dlp++)
  355. !     if (dlp->bin[0] != NULL && !strcmp (p, dlp->bin))
  356.         {
  357.           /*
  358.            * The directory we're working on is in the config file.
  359. --- 340,357 ----
  360.   
  361.     for (p = tmppath; ; p = end+1)
  362.       {
  363. + #ifdef __EMX__
  364. +       if (end = strchr(p, ';'))
  365. + #else
  366.         if (end = strchr(p, ':'))
  367. + #endif
  368.       *end = '\0';
  369.   
  370.         if (debug)
  371.       fprintf (stderr, "\npath directory %s ", p);
  372.   
  373. !       for (dlp = list; dlp->mandir[0] != 0; dlp++)
  374. !     if (dlp->bin[0] != 0 && !strcmp (p, dlp->bin))
  375.         {
  376.           /*
  377.            * The directory we're working on is in the config file.
  378. ***************
  379. *** 421,427 ****
  380. --- 421,431 ----
  381.     while (*lp != NULL)
  382.       {
  383.         strcat (manpathlist, *lp);
  384. + #ifdef __EMX__
  385. +       strcat (manpathlist, ";");
  386. + #else
  387.         strcat (manpathlist, ":");
  388. + #endif
  389.         lp++;
  390.       }
  391.   
  392. ***************
  393. *** 457,463 ****
  394.   {
  395.     int len;
  396.     register char *t;
  397. !   register struct stat sb;
  398.     extern int stat ();
  399.   
  400.     len = strlen (p);
  401. --- 473,479 ----
  402.   {
  403.     int len;
  404.     register char *t;
  405. !   struct stat sb;
  406.     extern int stat ();
  407.   
  408.     len = strlen (p);
  409.