*** misc.c.org	Fri Nov  5 02:15:04 1993
--- misc.c	Fri Nov  5 02:16:51 1993
***************
*** 210,215 ****
--- 210,222 ----
    if ( (file = fopen(filename,"r")) != NULL)
      return(file);
  
+ #ifdef ALTERNATIVE_COMPRESSION_EXTENSION
+   sprintf(filename, "%s/%s%s/%s.%s", path, CAT, 
+ 	  section + len_cat, page, ALTERNATIVE_COMPRESSION_EXTENSION);
+   if ( (file = Uncompress(man_globals, filename)) != NULL) 
+     return(file);
+ #endif
+ 
  /*
   * Then for compressed files in an uncompressed directory.
   */
***************
*** 245,250 ****
--- 252,264 ----
  	  COMPRESSION_EXTENSION, page);
    if ( (file = Uncompress(man_globals, filename)) != NULL)
      return(file);
+ 
+ #ifdef ALTERNATIVE_COMPRESSION_EXTENSION
+   sprintf(filename, "%s/%s%s.%s/%s", path, CAT, section + len_cat,
+ 	  ALTERNATIVE_COMPRESSION_EXTENSION, page);
+   if ( (file = Uncompress(man_globals, filename)) != NULL)
+     return(file);
+ #endif
  /*
   * We did not find any preformatted manual pages, try to format it.
   */
***************
*** 469,474 ****
--- 483,498 ----
  	    CAT, section + len_cat, page, COMPRESSION_EXTENSION);
      return(TRUE);
    }
+ 
+ #ifdef ALTERNATIVE_COMPRESSION_EXTENSION
+   sprintf(input, "%s.%s", filename, ALTERNATIVE_COMPRESSION_EXTENSION);
+   if ( UncompressNamed(man_globals, input, filename) ) {
+     man_globals->compress = TRUE;
+     sprintf(man_globals->save_file, "%s/%s%s/%s.%s", path,
+ 	    CAT, section + len_cat, page, ALTERNATIVE_COMPRESSION_EXTENSION);
+     return(TRUE);
+   }
+ #endif
  /*
   * And lastly files in a compressed directory.
   */
***************
*** 481,486 ****
--- 505,522 ----
  	    CAT, section + len_cat, COMPRESSION_EXTENSION, page);
      return(TRUE);
    }
+ 
+ #ifdef ALTERNATIVE_COMPRESSION_EXTENSION
+   sprintf(input, "%s/%s%s.%s/%s", path, 
+ 	  MAN, section + len_man, ALTERNATIVE_COMPRESSION_EXTENSION, page);
+   if ( UncompressNamed(man_globals, input, filename) ) {
+     man_globals->compress = TRUE;
+     sprintf(man_globals->save_file, "%s/%s%s.%s/%s", path, 
+ 	    CAT, section + len_cat, ALTERNATIVE_COMPRESSION_EXTENSION, page);
+     return(TRUE);
+   }
+ #endif
+ 
    return(FALSE);
  }
    
*** man.c.org	Fri Nov  5 02:15:03 1993
--- man.c	Fri Nov  5 02:16:34 1993
***************
*** 1,7 ****
  /*
   * xman - X Window System manual page display program.
   *
-  * $XFree86: mit/clients/xman/man.c,v 2.0 1993/07/28 11:52:54 dawes Exp $
   * $XConsortium: man.c,v 1.29 91/07/30 22:03:20 rws Exp $
   *
   * Copyright 1987, 1988 Massachusetts Institute of Technology
--- 1,6 ----
***************
*** 48,57 ****
  static void AddToCurrentSection();
  static void ReadCurrentSection();
  
- #ifdef MANCONF
- Bool ReadManConfig();
- #endif
- 
  #define SECT_ERROR -1
  
  /*	Function Name: Man
--- 47,52 ----
***************
*** 74,89 ****
  
    ptr = getenv("MANPATH");
    if (ptr == NULL || streq(ptr , "") ) {
! #ifdef MANCONF
!     if (!ReadManConfig(manpath))
! #endif
!     {
!       strcpy(manpath, SYSMANPATH);
  #ifdef LOCALMANPATH
!       strcat(manpath, ":");
!       strcat(manpath, LOCALMANPATH);
  #endif
-     }
    } else {
      strcpy(manpath, ptr);
    }
--- 69,79 ----
  
    ptr = getenv("MANPATH");
    if (ptr == NULL || streq(ptr , "") ) {
!     strcpy(manpath, SYSMANPATH);
  #ifdef LOCALMANPATH
!     strcat(manpath, ":");
!     strcat(manpath, LOCALMANPATH);
  #endif
    } else {
      strcpy(manpath, ptr);
    }
***************
*** 122,128 ****
        else {
  	if ( ++sect >= num_alloced ) {
  	  num_alloced += SECTALLOC;
! 	  manual = (Manual *) XtRealloc ( (char *) manual,
  				        (sizeof(Manual) * num_alloced));
  	  if (manual == NULL) 
  	    PrintError("Could not allocate memory for manual sections.");
--- 112,118 ----
        else {
  	if ( ++sect >= num_alloced ) {
  	  num_alloced += SECTALLOC;
! 	  manual = (Manual *) realloc ( (char *) manual,
  				        (sizeof(Manual) * num_alloced));
  	  if (manual == NULL) 
  	    PrintError("Could not allocate memory for manual sections.");
***************
*** 151,157 ****
   * realloc manual to be minimum space necessary.
   */
  
!   manual = (Manual *) XtRealloc( (char *) manual, (sizeof(Manual) * sect));
    if (manual == NULL) 
      PrintError("Could not allocate memory for manual sections.");
  
--- 141,147 ----
   * realloc manual to be minimum space necessary.
   */
  
!   manual = (Manual *) realloc( (char *) manual, (sizeof(Manual) * sect));
    if (manual == NULL) 
      PrintError("Could not allocate memory for manual sections.");
  
***************
*** 377,390 ****
   * Remove the compression extension from the path name.
   */
  
!   if ( (ptr = rindex(path, '.')) != NULL) 
! #if !defined(SCO) && !defined(ISC)
      if (streq(ptr + 1, COMPRESSION_EXTENSION)) 
- #else
-     if (strpbrk(ptr + 1, COMPRESSION_EXTENSIONS) != NULL)
- #endif
        *ptr = '\0';
!   
    nentries = local_manual->nentries;
    nalloc = local_manual->nalloc;
  
--- 367,380 ----
   * Remove the compression extension from the path name.
   */
  
!   if ( (ptr = rindex(path, '.')) != NULL) {
      if (streq(ptr + 1, COMPRESSION_EXTENSION)) 
        *ptr = '\0';
! #ifdef ALTERNATIVE_COMPRESSION_EXTENSION
!     if (streq(ptr + 1, ALTERNATIVE_COMPRESSION_EXTENSION)) 
!       *ptr = '\0';
! #endif
!   } 
    nentries = local_manual->nentries;
    nalloc = local_manual->nalloc;
  
***************
*** 410,422 ****
   * Remove the compression extension from the entry name.
   */
  
!     if ( (ptr = rindex(full_name, '.')) != NULL) 
! #if !defined(SCO) && !defined(ISC)
        if (streq(ptr + 1, COMPRESSION_EXTENSION)) 
- #else
-       if (strpbrk(ptr + 1, COMPRESSION_EXTENSIONS) != NULL)
- #endif
  	*ptr = '\0';
      local_manual->entries[nentries] = StrAlloc(full_name);
      local_manual->entries_less_paths[nentries] = 
        rindex(local_manual->entries[nentries], '/');
--- 400,413 ----
   * Remove the compression extension from the entry name.
   */
  
!     if ( (ptr = rindex(full_name, '.')) != NULL) {
        if (streq(ptr + 1, COMPRESSION_EXTENSION)) 
  	*ptr = '\0';
+ #ifdef ALTERNATIVE_COMPRESSION_EXTENSION
+       if (streq(ptr + 1, ALTERNATIVE_COMPRESSION_EXTENSION)) 
+ 	*ptr = '\0';
+ #endif
+     }
      local_manual->entries[nentries] = StrAlloc(full_name);
      local_manual->entries_less_paths[nentries] = 
        rindex(local_manual->entries[nentries], '/');
***************
*** 914,958 ****
  }
  
  #endif /* DEBUG */
- 
- #ifdef MANCONF
- 
- /*	Function Name: ReadManConfig
-  *	Description: Reads man.conf file used by BSD 4.4
-  *      Argument: manpath - char array to return path in.
-  *	Returns: TRUE if read was successful.
-  */
- 
- Bool
- ReadManConfig(manpath)
- 
- char	manpath[];
- 
- {
-   FILE	*fp;
-   char	line[BUFSIZ];
-   char	*path;
-   Bool  firstpath = TRUE;
- 
-   if (!(fp = fopen(MANCONF, "r")))
-     return(FALSE);
- 
-   while (fgets(line, sizeof(line), fp)) {
-     path = strtok(line, " \t\n");
-     if (!path || *path == '#' || strcmp(path, "_default"))
-       continue;
-     while (path = strtok((char *)NULL, " \t\n")) {
-       if (firstpath) {
-         strcpy(manpath, path);
-         firstpath = FALSE;
-       }
-       else {
-         strcat(manpath, ":");
-         strcat(manpath, path);
-       }
-     }
-   }
-   fclose(fp);
-   return(!firstpath);
- }
- #endif /* MANCONF */
--- 905,907 ----
*** vendor.h.org	Fri Nov  5 02:15:04 1993
--- vendor.h	Fri Nov  5 02:16:43 1993
***************
*** 102,110 ****
--- 102,117 ----
  #      define UNCOMPRESS_FORMAT_3     "fcat < %s > %s"
  #      define NO_COMPRESS
  #    else
+ #    if defined ( linux )
+ #      define COMPRESSION_EXTENSION "gz"
+ #      define ALTERNATIVE_COMPRESSION_EXTENSION "z"
+ #      define UNCOMPRESS_FORMAT     "zcat < %s > %s"
+ #      define COMPRESS              "gzip"
+ #    else
  #      define COMPRESSION_EXTENSION "Z"
  #      define UNCOMPRESS_FORMAT     "zcat < %s > %s"
  #      define COMPRESS              "compress"
+ #    endif /* linux */
  #    endif /* ISC */
  #  endif /* UTEK */
  #endif /* macII, hcx, SYSV386, sgi */
