home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1994 #1
/
monster.zip
/
monster
/
OS2
/
MAN11A.ZIP
/
src
/
patches.os2
< prev
next >
Wrap
Text File
|
1994-01-23
|
15KB
|
677 lines
Only in new: config.h
Only in new: director.c
Only in new: getopt.c
Only in new: include
Only in new: Makefile.os2
diff -c man-1.1/makewhatis.sh new/makewhatis.sh
*** man-1.1/makewhatis.sh Sun Aug 25 20:35:38 1991
--- new/makewhatis.sh Sun Jan 23 15:22:38 1994
***************
*** 29,34 ****
--- 29,35 ----
do
if [ -d $subdir ]
then
+ cd $subdir
for f in `find . -name '*' -print`
do
sed -n '/^\.TH.*$/p
diff -c man-1.1/man.c new/man.c
*** man-1.1/man.c Mon Aug 26 05:01:02 1991
--- new/man.c Wed Jan 05 00:53:44 1994
***************
*** 19,25 ****
--- 19,27 ----
#include <stdio.h>
#include <ctype.h>
#include <string.h>
+ #ifndef _MSC_VER
#include <sys/file.h>
+ #endif
#include <signal.h>
#include "config.h"
#include "gripes.h"
***************
*** 80,85 ****
--- 82,89 ----
static int whatis;
static int findall;
static int print_where;
+ static char nroff_cmd[] = NROFF;
+ static char *nroff = nroff_cmd;
#ifdef ALT_SYSTEMS
static int alt_system;
***************
*** 94,101 ****
--- 98,109 ----
#ifdef ALT_SYSTEMS
static char args[] = "M:P:S:adfhkm:p:tw?";
#else
+ #ifdef OS2
+ static char args[] = "M:N:P:S:adfhkp:tw?";
+ #else
static char args[] = "M:P:S:adfhkp:tw?";
#endif
+ #endif
#else
#ifdef ALT_SYSTEMS
static char args[] = "M:P:S:adfhkm:p:w?";
***************
*** 184,193 ****
--- 192,207 ----
"usage: %s [-adfhktw] [section] [-M path] [-P pager] [-S list]\n\
[-m system] [-p string] name ...\n\n";
#else
+ #ifdef OS2
+ static char s1[] =
+ "usage: %s [-adfhktw] [section] [-M path] [-N nroff] [-P pager] [-S list]\n\
+ [-p string] name ...\n\n";
+ #else
static char s1[] =
"usage: %s [-adfhktw] [section] [-M path] [-P pager] [-S list]\n\
[-p string] name ...\n\n";
#endif
+ #endif
#else
#ifdef ALT_SYSTEMS
static char s1[] =
***************
*** 206,244 ****
h : print this help message\n\
k : same as apropos(1)\n";
- #ifdef HAS_TROFF
- static char s3[] = " t : use troff to format pages for printing\n";
- #endif
-
- static char s4[] = " w : print location of man page(s) that would be displayed\n\n\
- M path : set search path for manual pages to `path'\n\
- P pager : use program `pager' to display pages\n\
- S list : colon separated section list\n";
-
- #ifdef ALT_SYSTEMS
- static char s5[] = " m system : search for alternate system's man pages\n";
- #endif
-
- static char s6[] = " p string : string tells which preprocessors to run\n\
- e - [n]eqn(1) p - pic(1) t - tbl(1)\n\
- g - grap(1) r - refer(1) v - vgrind(1)\n";
-
strcat (usage_string, s1);
strcat (usage_string, s2);
#ifdef HAS_TROFF
! strcat (usage_string, s3);
#endif
! strcat (usage_string, s4);
! #ifdef ALT_SYSTEMS
! strcat (usage_string, s5);
#endif
! strcat (usage_string, s6);
! fprintf (stderr, usage_string, prognam, version, prognam);
exit(1);
}
--- 220,256 ----
h : print this help message\n\
k : same as apropos(1)\n";
strcat (usage_string, s1);
strcat (usage_string, s2);
#ifdef HAS_TROFF
! strcat(usage_string, " t : use troff to format pages for printing\n");
#endif
! strcat(usage_string,
! " w : print location of man page(s) that would be displayed\n\n");
! fprintf (stderr, usage_string, prognam, version, prognam);
!
! fprintf(stderr,
! " M path : set search path for manual pages to `path'\n");
! #ifdef OS2
! fprintf(stderr,
! " N nroff : set nroff command (%s)\n", nroff);
#endif
+ fprintf(stderr, "\
+ P pager : use program `pager' to display pages\n\
+ S list : colon separated section list\n");
! #ifdef ALT_SYSTEMS
! fprintf(stderr,
! " m system : search for alternate system's man pages\n";
! #endif
! fprintf(stderr, "\
! p string : string tells which preprocessors to run\n\
! e - [n]eqn(1) p - pic(1) t - tbl(1)\n\
! g - grap(1) r - refer(1) v - vgrind(1)\n");
exit(1);
}
***************
*** 286,291 ****
--- 298,308 ----
extern void downcase ();
extern char *manpath ();
+ #ifdef OS2
+ if (NULL == (nroff = getenv("NROFF")))
+ nroff = (_osmode == DOS_MODE || _osmajor < 20) ? NROFF16 : nroff_cmd;
+ #endif
+
while ((c = getopt (argc, argv, args)) != EOF)
{
switch (c)
***************
*** 293,298 ****
--- 310,320 ----
case 'M':
manp = strdup (optarg);
break;
+ #ifdef OS2
+ case 'N':
+ nroff = optarg;
+ break;
+ #endif
case 'P':
pager = strdup (optarg);
break;
***************
*** 390,399 ****
/*
* Expand the manpath into a list for easier handling.
*/
mp = manpathlist;
for (p = manp; ; p = end+1)
{
! if ((end = strchr (p, ':')) != NULL)
*end = '\0';
#ifdef ALT_SYSTEMS
--- 412,425 ----
/*
* Expand the manpath into a list for easier handling.
*/
+ #ifdef OS2
+ for (p = manp; p = strchr(p, '\\'); )
+ *p = '/';
+ #endif
mp = manpathlist;
for (p = manp; ; p = end+1)
{
! if ((end = strchr (p, PATHSEP)) != NULL)
*end = '\0';
#ifdef ALT_SYSTEMS
***************
*** 421,427 ****
if (end == NULL)
break;
! *end = ':';
}
*mp = NULL;
}
--- 447,453 ----
if (end == NULL)
break;
! *end = PATHSEP;
}
*mp = NULL;
}
***************
*** 440,446 ****
register char **vs;
for (vs = section_list; *vs != NULL; vs++)
! if ((strcmp (*vs, name) == NULL) || (isdigit (name[0])))
return strdup (name);
return NULL;
--- 466,472 ----
register char **vs;
for (vs = section_list; *vs != NULL; vs++)
! if ((strcmp (*vs, name) == 0) || (isdigit (name[0])))
return strdup (name);
return NULL;
***************
*** 506,517 ****
#ifdef DO_COMPRESS
if (to_cat)
{
! int len = strlen (name) + 3;
to_name = (char *) malloc (len);
if (to_name == NULL)
gripe_alloc (len, "to_name");
strcpy (to_name, name);
! strcat (to_name, ".Z");
}
else
to_name = strdup (name);
--- 532,543 ----
#ifdef DO_COMPRESS
if (to_cat)
{
! int len = strlen (name) + strlen(COMPRESS_EXT) + 1;
to_name = (char *) malloc (len);
if (to_name == NULL)
gripe_alloc (len, "to_name");
strcpy (to_name, name);
! strcat (to_name, COMPRESS_EXT);
}
else
to_name = strdup (name);
***************
*** 522,528 ****
t1 = strrchr (to_name, '/');
if (t1 != NULL)
{
! *t1 = NULL;
t2 = strrchr (to_name, '/');
*t1 = '/';
}
--- 548,554 ----
t1 = strrchr (to_name, '/');
if (t1 != NULL)
{
! *t1 = '\0';
t2 = strrchr (to_name, '/');
*t1 = '/';
}
***************
*** 640,672 ****
{
char *expander = NULL;
int len = strlen (file);
! if (file[len - 2] == '.')
! {
! switch (file[len - 1])
! {
! #ifdef FCAT
! case 'F':
! if (strcmp (FCAT, "") != 0)
! expander = strdup (FCAT);
! break;
! #endif
! #ifdef YCAT
! case 'Y':
! if (strcmp (YCAT, "") != 0)
! expander = strdup (YCAT);
! break;
! #endif
! #ifdef ZCAT
! case 'Z':
! if (strcmp (ZCAT, "") != 0)
! expander = strdup (ZCAT);
! break;
! #endif
! default:
! break;
! }
! }
return expander;
}
#endif
--- 666,682 ----
{
char *expander = NULL;
int len = strlen (file);
+ int i;
+ UNCOMPRESS *u = uncompress;
! while (u->ext) {
! if (0 < (i = len - strlen(u->ext)))
! if (!strcmp(file + i, u->ext)) {
! expander = u->prog;
! break;
! }
! u++;
! }
return expander;
}
#endif
***************
*** 881,887 ****
#endif
{
strcat (buf, " | ");
! strcat (buf, NROFF);
}
if (tbl_found && !troff && strcmp (COL, "") != 0)
--- 891,897 ----
#endif
{
strcat (buf, " | ");
! strcat (buf, nroff);
}
if (tbl_found && !troff && strcmp (COL, "") != 0)
***************
*** 985,1001 ****
else
#endif
{
! if (strcmp (TBL, "") != 0)
{
strcpy (buf, TBL);
strcat (buf, " ");
strcat (buf, file);
strcat (buf, " | ");
! strcat (buf, NROFF);
}
else
{
! strcpy (buf, NROFF);
strcat (buf, " ");
strcat (buf, file);
}
--- 995,1011 ----
else
#endif
{
! if (nroff == nroff_cmd && strcmp (TBL, "") != 0)
{
strcpy (buf, TBL);
strcat (buf, " ");
strcat (buf, file);
strcat (buf, " | ");
! strcat (buf, nroff);
}
else
{
! strcpy (buf, nroff);
strcat (buf, " ");
strcat (buf, file);
}
***************
*** 1009,1014 ****
--- 1019,1055 ----
return buf;
}
+ char *
+ path_fixup(s)
+ char *s;
+ {
+ #if defined(OS2)
+ char *p = s;
+
+ if (s)
+ while (p = strchr(p, '/')) *p = '\\';
+ #endif
+ return s;
+ }
+
+ char *
+ chdir_fmt(path)
+ char *path;
+ {
+ static char buf[MAXPATHLEN+9];
+
+ #ifdef OS2
+ /*
+ sprintf(buf, "cd %s & ", path);
+ path_fixup(buf+3);
+ */
+ *buf = '\0';
+ #else
+ sprintf(buf, "cd %s ; ", path);
+ #endif
+ return(buf);
+ }
+
/*
* Try to format the man page and create a new formatted file. Return
* 1 for success and 0 for failure.
***************
*** 1035,1044 ****
return 0;
else
#ifdef DO_COMPRESS
! sprintf (command, "(cd %s ; %s | %s > %s)", path,
roff_command, COMPRESSOR, cat_file);
#else
! sprintf (command, "(cd %s ; %s > %s)", path,
roff_command, cat_file);
#endif
/*
--- 1076,1085 ----
return 0;
else
#ifdef DO_COMPRESS
! sprintf (command, "(%s%s | %s > %s)", chdir_fmt(path),
roff_command, COMPRESSOR, cat_file);
#else
! sprintf (command, "(%s%s > %s)", chdir_fmt(path),
roff_command, cat_file);
#endif
/*
***************
*** 1103,1109 ****
if (roff_command == NULL)
return 0;
else
! sprintf (command, "(cd %s ; %s)", path, roff_command);
found = do_system_command (command);
}
--- 1144,1150 ----
if (roff_command == NULL)
return 0;
else
! sprintf (command, "(%s%s)", chdir_fmt(path), roff_command);
found = do_system_command (command);
}
***************
*** 1162,1168 ****
if (roff_command == NULL)
return 0;
else
! sprintf (command, "(cd %s ; %s | %s)", path,
roff_command, pager);
found = do_system_command (command);
--- 1203,1209 ----
if (roff_command == NULL)
return 0;
else
! sprintf (command, "(%s%s | %s)", chdir_fmt(path),
roff_command, pager);
found = do_system_command (command);
***************
*** 1250,1256 ****
}
else
{
! found += display_cat_file (*np);
}
}
}
--- 1291,1297 ----
}
else
{
! found += display_cat_file (path_fixup(*np));
}
}
}
***************
*** 1276,1282 ****
fprintf (stderr, "will try to write %s if needed\n", cat_file);
}
! found += format_and_display (path, man_file, cat_file);
}
}
#endif /* NROFF_MISSING */
--- 1317,1323 ----
fprintf (stderr, "will try to write %s if needed\n", cat_file);
}
! found += format_and_display (path, man_file, path_fixup(cat_file));
}
}
#endif /* NROFF_MISSING */
Only in new: man.def
Only in new: man32.def
diff -c man-1.1/manpath.c new/manpath.c
*** man-1.1/manpath.c Sun Aug 25 21:45:42 1991
--- new/manpath.c Thu Jan 06 20:05:52 1994
***************
*** 186,194 ****
DIRLIST *dlp = list;
FILE *config;
! if ((config = fopen (config_file, "r")) == NULL)
! gripe_getting_mp_config (config_file);
while ((bp = fgets (buf, BUFSIZ, config)) != NULL)
{
while (*bp && (*bp == ' ' || *bp == '\t'))
--- 186,207 ----
DIRLIST *dlp = list;
FILE *config;
! #ifdef OS2
! char *config_file_sp[] = {"INIT", "DPATH", "PATH", NULL};
+ for (i = 0; config_file_sp[i]; i++) {
+ _searchenv(config_file, config_file_sp[i], buf);
+ if (*buf) break;
+ }
+ #else
+ *buf = '\0';
+ #endif
+ if (*buf == '\0')
+ strcpy(buf, config_file);
+
+ if ((config = fopen (buf, "r")) == NULL)
+ gripe_getting_mp_config (buf);
+
while ((bp = fgets (buf, BUFSIZ, config)) != NULL)
{
while (*bp && (*bp == ' ' || *bp == '\t'))
***************
*** 315,321 ****
len = strlen (path);
memcpy (p, path, len);
p += len;
! *p++ = ':';
dlp++;
}
}
--- 328,334 ----
len = strlen (path);
memcpy (p, path, len);
p += len;
! *p++ = PATHSEP;
dlp++;
}
}
***************
*** 352,361 ****
char *has_subdirs ();
tmppath = strdup (path);
!
for (p = tmppath; ; p = end+1)
{
! if (end = strchr(p, ':'))
*end = '\0';
if (debug)
--- 365,376 ----
char *has_subdirs ();
tmppath = strdup (path);
! #ifdef OS2
! for (p = tmppath; p = strchr(p, '\\'); p++) *p = '/';
! #endif
for (p = tmppath; ; p = end+1)
{
! if (end = strchr(p, PATHSEP))
*end = '\0';
if (debug)
***************
*** 366,372 ****
* If we haven't added it to the list yet, do.
*/
for (dlp = list; dlp->mandir[0] != '\0'; dlp++)
! if (dlp->bin[0] != '\0' && !strcmp (p, dlp->bin))
{
if (debug)
fprintf (stderr, "is in the config file\n");
--- 381,392 ----
* If we haven't added it to the list yet, do.
*/
for (dlp = list; dlp->mandir[0] != '\0'; dlp++)
! if (dlp->bin[0] != '\0' &&
! #ifdef OS2
! !stricmp (p, dlp->bin))
! #else
! !strcmp (p, dlp->bin))
! #endif
{
if (debug)
fprintf (stderr, "is in the config file\n");
***************
*** 422,428 ****
lp++;
}
! manpathlist = (char *) malloc (len);
if (manpathlist == NULL)
gripe_alloc (len, "manpathlist");
--- 442,448 ----
lp++;
}
! manpathlist = (char *) malloc (len+1);
if (manpathlist == NULL)
gripe_alloc (len, "manpathlist");
***************
*** 435,445 ****
len = strlen (*lp);
memcpy (p, *lp, len);
p += len;
! *p++ = ':';
lp++;
}
! p[-1] = '\0';
return manpathlist;
}
--- 455,466 ----
len = strlen (*lp);
memcpy (p, *lp, len);
p += len;
! *p++ = PATHSEP;
lp++;
}
! if (p > manpathlist)
! p[-1] = '\0';
return manpathlist;
}
Only in new: manpath.def
Only in new: manpath32.def