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 2.4 by greg, Tue Sep 8 09:09:23 1992 UTC vs.
Revision 2.5 by greg, Tue Sep 8 10:04:29 1992 UTC

# Line 19 | Line 19 | FILE *
19   fropen(fname)                   /* find file and open for reading */
20   register char  *fname;
21   {
22 <        extern char  *strcpy();
22 >        extern char  *strcpy(), *getenv();
23          FILE  *fp;
24 <        char  pname[256];
24 >        char  pname[MAXPATH];
25          register char  *sp, *cp;
26  
27          if (fname == NULL)
28                  return(NULL);
29  
30 <        if (fname[0] == DIRSEP || fname[0] == '.')      /* absolute path */
30 >        if (ISDIRSEP(fname[0]) || fname[0] == '.')      /* absolute path */
31                  return(fopen(fname, "r"));
32                  
33          if (libpath == NULL) {                  /* get search path */
# Line 41 | Line 41 | register char  *fname;
41                  cp = pname;
42                  while (*sp && (*cp = *sp++) != PATHSEP)
43                          cp++;
44 <                if (cp > pname && cp[-1] != DIRSEP)
44 >                if (cp > pname && !ISDIRSEP(cp[-1]))
45                          *cp++ = DIRSEP;
46                  strcpy(cp, fname);
47                  if ((fp = fopen(pname, "r")) != NULL)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines