ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/fropen.c
(Generate patch)

Comparing ray/src/common/fropen.c (file contents):
Revision 1.1 by greg, Sat Dec 8 09:28:15 1990 UTC vs.
Revision 1.2 by greg, Sun Dec 9 09:21:05 1990 UTC

# Line 17 | Line 17 | static char SCCSid[] = "$SunId$ LBL";
17   #define ULIBVAR         "RAYPATH"
18   #endif
19  
20 + char  *libpath = NULL;          /* library search path */
21  
22 +
23   FILE *
24   fropen(fname)                   /* find file and open for reading */
25   register char  *fname;
26   {
27          extern char  *strcpy(), *getenv();
26        static char  *searchpath;
28          FILE  *fp;
29          char  pname[256];
30          register char  *sp, *cp;
# Line 34 | Line 35 | register char  *fname;
35          if (fname[0] == '/' || fname[0] == '.') /* absolute path */
36                  return(fopen(fname, "r"));
37                  
38 <        if (searchpath == NULL) {               /* get search path */
39 <                searchpath = getenv(ULIBVAR);
40 <                if (searchpath == NULL)
41 <                        searchpath = DEFPATH;
38 >        if (libpath == NULL) {                  /* get search path */
39 >                libpath = getenv(ULIBVAR);
40 >                if (libpath == NULL)
41 >                        libpath = DEFPATH;
42          }
43                                                  /* check search path */
44 <        sp = searchpath;
44 >        sp = libpath;
45          do {
46                  cp = pname;
47                  while (*sp && (*cp = *sp++) != ':')

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines