sprintf(filename, "%s/%s%s/%s.%s", path, CAT, section + len_cat, page, COMPRESSION_EXTENSION);
sprintf(filename, "%s/%s%s/%s.%s.%s", path, CAT, section + len_cat, page, suffix, COMPRESSION_EXTENSION);
FindManualFile(man_globals, section_num, entry_num)ManpageGlobals * man_globals;int section_num, entry_num;{  FILE * file;  char path[BUFSIZ], page[BUFSIZ], section[BUFSIZ], *temp;  char filename[BUFSIZ];  char * entry = manual[section_num].entries[entry_num];  int len_cat = strlen(CAT);#if defined(ISC) || defined(SCO)  int i;#endif  temp = CreateManpageName(entry);  sprintf(man_globals->manpage_title, "The current manual page is: %s.", temp);  XtFree(temp);    ParseEntry(entry, path, section, page);/* * Look for uncompressed files first. */#if defined(__OpenBSD__) || defined(__NetBSD__)  /* look in machine subdir first */  sprintf(filename, "%s/%s%s/%s/%s", path, CAT, 	  section + len_cat, MACHINE, page);  if ( (file = fopen(filename,"r")) != NULL)    return(file);#endif    sprintf(filename, "%s/%s%s/%s", path, CAT, section + len_cat, page);  if ( (file = fopen(filename,"r")) != NULL)    return(file);/* * Then for compressed files in an uncompressed directory. */#if !defined(ISC) && !defined(SCO)#if defined(__OpenBSD__) || defined(__NetBSD__)  /* look in machine subdir first */  sprintf(filename, "%s/%s%s/%s/%s.%s", path, CAT, 	  section + len_cat, MACHINE, page, COMPRESSION_EXTENSION);  if ( (file = Uncompress(man_globals, filename)) != NULL)    return(file);#endif  sprintf(filename, "%s/%s%s/%s.%s", path, CAT, 	  section + len_cat, page, COMPRESSION_EXTENSION);  if ( (file = Uncompress(man_globals, filename)) != NULL)     return(file);#ifdef GZIP_EXTENSION  else {#if defined(__OpenBSD__) || defined(__NetBSD__)      /* look in machine subdir first */      sprintf(filename, "%s/%s%s/%s/%s.%s", path, CAT, 	      section + len_cat, MACHINE, page, GZIP_EXTENSION);      if ( (file = Uncompress(man_globals, filename)) != NULL)	  return(file);#endif    sprintf(filename, "%s/%s%s/%s.%s", path, CAT,	    section + len_cat, page, GZIP_EXTENSION);    if ( (file = Uncompress(man_globals, filename)) != NULL)       return(file);  }#endif#else  for(i = 0; i < strlen(COMPRESSION_EXTENSIONS); i++) {      sprintf(filename, "%s/%s%s/%s.%c", path, CAT,            section + len_cat, page, COMPRESSION_EXTENSIONS[i]);      uncompress_format = uncompress_formats[i];#ifdef DEBUG      printf("Trying .%c ...\n", COMPRESSION_EXTENSIONS[i]);#endif      if ( (file = Uncompress(man_globals, filename)) != NULL) 	return(file);  }#endif/* * And lastly files in a compressed directory. * * The directory is not actually compressed it is just named man#.Z * and all files in it are compressed without the .Z extension. * HP does it this way (really :-). */  sprintf(filename, "%s/%s%s.%s/%s", path, CAT, section + len_cat,	  COMPRESSION_EXTENSION, page);  if ( (file = Uncompress(man_globals, filename)) != NULL)    return(file);/* * We did not find any preformatted manual pages, try to format it. */  return(Format(man_globals, entry));}