home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume30 / mserv-3.0 / part04 / ixlookup.patch < prev    next >
Encoding:
Text File  |  1992-06-19  |  1.1 KB  |  43 lines

  1. # ixlookup.patch -- patch to GNU locate
  2. # SCCS Status     : @(#)@ ixlookup.patch    1.3
  3. # Author          : Johan Vromans
  4. # Created On      : Thu May  7 20:51:33 1992
  5. # Last Modified By: Johan Vromans
  6. # Last Modified On: Wed Jun 10 11:57:25 1992
  7. # Update Count    : 2
  8. # Status          : OK
  9.  
  10. This patch enhances GNU locate with the possibility to select a
  11. database using environment variable FCODES.
  12.  
  13. This patch is based on GNU find 3.5.
  14.  
  15. *** /usr/local/src/find-3.5/locate/locate.c    Tue Dec 24 08:37:44 1991
  16. --- ixlookup.c    Wed Apr 22 13:28:51 1992
  17. ***************
  18. *** 97,106 ****
  19.     int path_max;
  20.     char bigram1[128], bigram2[128];
  21.     int found = NO;
  22.   
  23. !   fp = fopen (FCODES, "r");
  24.     if (fp == NULL)
  25. !     error (1, errno, "%s", FCODES);
  26.   
  27.     path_max = PATH_MAX;
  28.     if (path_max < 1)
  29. --- 97,109 ----
  30.     int path_max;
  31.     char bigram1[128], bigram2[128];
  32.     int found = NO;
  33. +   char *fcodes = (char*) getenv ("LOCATE_DB");
  34. +   if ( fcodes == NULL )
  35. +     fcodes = FCODES;
  36.   
  37. !   fp = fopen (fcodes, "r");
  38.     if (fp == NULL)
  39. !     error (1, errno, "%s", fcodes);
  40.   
  41.     path_max = PATH_MAX;
  42.     if (path_max < 1)
  43.