49{
51 if (path[0]=='~')
52 {
54 {
55 const char* home =
getenv(
"HOME");
56#ifdef __CUGWIN__
57 if ((home==
NULL)||(!access(home,X_OK)))
59#endif
61 {
62 strcpy(longpath, home);
63 strcat(longpath, &(path[1]));
64 path = longpath;
65 }
66 }
67#if defined(HAVE_PWD_H) && defined(HAVE_GETPWNAM)
68 else
69 {
70 char* dir_sep;
71 struct passwd *pw_entry;
72 strcpy (longpath, path);
73 dir_sep = strchr(longpath,
DIR_SEP);
75 {
77 strcpy(
buf,
"illegal ~ in filename >>");
78 strncat(
buf,longpath,235);
82 }
83 *dir_sep = '\0';
84 pw_entry = getpwnam(&longpath[1]);
86 {
87 strcpy(longpath, pw_entry->pw_dir);
88 dir_sep = strchr((
char *)path,
DIR_SEP);
89 strcat(longpath, dir_sep);
90 path = longpath;
91 }
92 }
93#endif
94 }
96 if (! path_only)
97 {
98 struct stat statbuf;
100 do
101 {
102 res = stat(path,&statbuf);
103 }
while((
res < 0) and (errno == EINTR));
105 && (S_ISREG(statbuf.st_mode)))
107 }
108 if (where!=
NULL) strcpy(where,path);
109 if ((*mode=='r') &&
111 ! (path[0] ==
'.' && path[1] ==
DIR_SEP) &&
113 {
117
120
122 {
126 {
127 *q = '\0';
132 if(!access(
s, R_OK)) {
found++;
break; }
134 }
136 {
140 }
143 {
146 }
147 }
148 else
149 {
150 if (where!=
NULL) strcpy(
s,path);
152 }
154 }
155 if ((
f==
NULL)&&(useWerror))
156 {
158 strcpy(
buf,
"cannot open `");
159 strncat(
buf,path,240);
162 }
164}
const CanonicalForm int s
void WerrorS(const char *s)
FILE * myfopen(const char *path, const char *mode)
static char * feResource(feResourceConfig config, int warn)
int status int void * buf