87 |
|
{ |
88 |
|
int retOK; |
89 |
|
SDData myBSDF; |
90 |
< |
char *pname; |
90 |
> |
char *pname, *fnbeg; |
91 |
|
/* find and load the XML file */ |
92 |
|
retOK = strlen(fname); |
93 |
< |
if (retOK < 5 || strcmp(fname+retOK-4, ".xml")) { |
93 |
> |
if (retOK < 5 || strcasecmp(fname+retOK-4, ".xml")) { |
94 |
|
fprintf(stderr, "%s: input does not end in '.xml'\n", fname); |
95 |
|
return(0); |
96 |
|
} |
99 |
|
fprintf(stderr, "%s: cannot find BSDF file\n", fname); |
100 |
|
return(0); |
101 |
|
} |
102 |
+ |
fnbeg = strrchr(fname, DIRSEP); |
103 |
+ |
if (fnbeg != NULL) /* eliminate directory */ |
104 |
+ |
fname = fnbeg+1; |
105 |
|
SDclearBSDF(&myBSDF, fname); |
106 |
|
if (SDreportError(SDloadFile(&myBSDF, pname), stderr)) |
107 |
|
return(0); |