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

Comparing ray/src/common/getpath.c (file contents):
Revision 2.7 by greg, Mon Sep 21 11:59:42 1992 UTC vs.
Revision 2.8 by greg, Thu Aug 26 10:14:32 1993 UTC

# Line 33 | Line 33 | int  mode;
33          if (fname == NULL)
34                  return(NULL);
35  
36 +        pname[0] = '\0';                /* check for full specification */
37          switch (*fname) {
38          CASEDIRSEP:                             /* relative to root */
39          case '.':                               /* relative to cwd */
40                  strcpy(pname, fname);
41 <                return(pname);
41 >                break;
42   #ifndef NIX
43          case '~':                               /* relative to home directory */
44                  fname++;
# Line 46 | Line 47 | int  mode;
47                                  return(NULL);
48                          strcpy(pname, cp);
49                          strcat(pname, fname);
50 <                        return(pname);
50 >                        break;
51                  }
52                  cp = pname;                                     /* user */
53                  do
# Line 57 | Line 58 | int  mode;
58                          return(NULL);
59                  strcpy(pname, pwent->pw_dir);
60                  strcat(pname, fname);
61 <                return(pname);
61 >                break;
62   #endif
63          }
64 +        if (pname[0])           /* got it, check access if search requested */
65 +                return(searchpath==NULL||access(pname,mode)==0 ? pname : NULL);
66  
67          if (searchpath == NULL) {                       /* don't search */
68                  strcpy(pname, fname);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines