version 1.28, 1995/10/11 19:39:35
|
version 1.29, 1995/10/26 22:48:41
|
Line 288 int main(int argc, char **argv, char **e
|
Line 288 int main(int argc, char **argv, char **e
|
} |
} |
} |
} |
path1=path; |
path1=path; |
do { |
|
char *pend=strchr(path, ':'); |
if(strchr(imagename, '/')==NULL) |
if (pend==NULL) |
{ |
pend=path+strlen(path); |
do { |
if (strlen(path)==0) { |
char *pend=strchr(path, ':'); |
fprintf(stderr,"%s: cannot open image file %s in path %s for reading\n", |
if (pend==NULL) |
progname, imagename, path1); |
pend=path+strlen(path); |
exit(1); |
if (strlen(path)==0) { |
|
fprintf(stderr,"%s: cannot open image file %s in path %s for reading\n", |
|
progname, imagename, path1); |
|
exit(1); |
|
} |
|
{ |
|
int dirlen=pend-path; |
|
char fullfilename[dirlen+strlen(imagename)+2]; |
|
memcpy(fullfilename, path, dirlen); |
|
if (fullfilename[dirlen-1]!='/') |
|
fullfilename[dirlen++]='/'; |
|
strcpy(fullfilename+dirlen,imagename); |
|
image_file=fopen(fullfilename,"rb"); |
|
} |
|
path=pend+(*pend==':'); |
|
} while (image_file==NULL); |
} |
} |
|
else |
{ |
{ |
int dirlen=pend-path; |
image_file=fopen(imagename,"rb"); |
char fullfilename[dirlen+strlen(imagename)+2]; |
if(image_file==NULL) |
memcpy(fullfilename, path, dirlen); |
fprintf(stderr,"%s: cannot open image file %s for reading\n", |
if (fullfilename[dirlen-1]!='/') |
progname, imagename); |
fullfilename[dirlen++]='/'; |
|
strcpy(fullfilename+dirlen,imagename); |
|
image_file=fopen(fullfilename,"rb"); |
|
} |
} |
path=pend+(*pend==':'); |
|
} while (image_file==NULL); |
|
|
|
{ |
{ |
Cell environ[]= { |
Cell environ[]= { |
(Cell)argc-(optind-1), |
(Cell)argc-(optind-1), |