--- ray/src/common/fropen.c 1992/09/08 10:04:29 2.5 +++ ray/src/common/fropen.c 2003/07/17 09:21:29 2.13 @@ -1,27 +1,27 @@ -/* Copyright (c) 1992 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: fropen.c,v 2.13 2003/07/17 09:21:29 schorsch Exp $"; #endif - /* * Find and open a Radiance library file. + * + * External symbols declared in standard.h */ +#include "copyright.h" + #include +#include "rtio.h" #include "paths.h" -char *libpath = NULL; /* library search path */ - FILE * -fropen(fname) /* find file and open for reading */ +frlibopen(fname) /* find file and open for reading */ register char *fname; { - extern char *strcpy(), *getenv(); + extern char *getrlibpath(); FILE *fp; - char pname[MAXPATH]; + char pname[PATH_MAX]; register char *sp, *cp; if (fname == NULL) @@ -29,14 +29,8 @@ register char *fname; if (ISDIRSEP(fname[0]) || fname[0] == '.') /* absolute path */ return(fopen(fname, "r")); - - if (libpath == NULL) { /* get search path */ - libpath = getenv(ULIBVAR); - if (libpath == NULL) - libpath = DEFPATH; - } /* check search path */ - sp = libpath; + sp = getrlibpath(); do { cp = pname; while (*sp && (*cp = *sp++) != PATHSEP)