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

Comparing ray/src/util/rmatrix.c (file contents):
Revision 2.83 by greg, Tue Oct 8 00:43:57 2024 UTC vs.
Revision 2.84 by greg, Sat Mar 22 01:27:22 2025 UTC

# Line 378 | Line 378 | rmx_load(const char *inspec, RMPref rmp)
378                  fp = stdin;
379          else if (inspec[0] == '!')
380                  fp = popen(inspec+1, "r");
381 <        else {
382 <                const char      *sp = inspec;   /* check suffix */
383 <                while (*sp)
384 <                        ++sp;
385 <                while (sp > inspec && sp[-1] != '.')
386 <                        --sp;
387 <                if (!strcasecmp(sp, "XML")) {   /* assume it's a BSDF */
381 >        else {                                  /* check suffix */
382 >                const char      *sp = strrchr(inspec, '.');
383 >                if (sp > inspec && !strcasecmp(sp+1, "XML")) {  /* BSDF? */
384                          CMATRIX *cm = rmp==RMPnone ? (CMATRIX *)NULL :
385                                          rmp==RMPtrans ? cm_loadBTDF(inspec) :
386                                          cm_loadBRDF(inspec, rmp==RMPreflB) ;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines