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.2 by greg, Tue Jun 16 13:06:58 1992 UTC vs.
Revision 2.3 by greg, Tue Jun 16 13:07:45 1992 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1992 Regents of the University of California */
1 > /* Copyright (c) 1990 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 16 | Line 16 | static char SCCSid[] = "$SunId$ LBL";
16   #ifndef ULIBVAR
17   #define ULIBVAR         "RAYPATH"
18   #endif
19 + #ifndef DIRSEP
20 + #define DIRSEP          '/'
21 + #endif
22 + #ifndef PATHSEP
23 + #define PATHSEP         ':'
24 + #endif
25  
26   char  *libpath = NULL;          /* library search path */
27  
# Line 32 | Line 38 | register char  *fname;
38          if (fname == NULL)
39                  return(NULL);
40  
41 <        if (fname[0] == '/' || fname[0] == '.') /* absolute path */
41 >        if (fname[0] == DIRSEP || fname[0] == '.')      /* absolute path */
42                  return(fopen(fname, "r"));
43                  
44          if (libpath == NULL) {                  /* get search path */
# Line 44 | Line 50 | register char  *fname;
50          sp = libpath;
51          do {
52                  cp = pname;
53 <                while (*sp && (*cp = *sp++) != ':')
54 <                        if (*cp == '\\') {              /* escape */
55 <                                if (*sp) *cp++ = *sp++;
56 <                        } else
51 <                                cp++;
52 <                if (cp > pname && cp[-1] != '/')
53 <                        *cp++ = '/';
53 >                while (*sp && (*cp = *sp++) != PATHSEP)
54 >                        cp++;
55 >                if (cp > pname && cp[-1] != DIRSEP)
56 >                        *cp++ = DIRSEP;
57                  strcpy(cp, fname);
58                  if ((fp = fopen(pname, "r")) != NULL)
59                          return(fp);                     /* got it! */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines