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

Comparing ray/src/util/cmatrix.c (file contents):
Revision 2.31 by greg, Fri Jan 15 18:31:38 2021 UTC vs.
Revision 2.32 by greg, Tue Jan 19 23:32:00 2021 UTC

# Line 15 | Line 15 | static const char RCSid[] = "$Id$";
15   #include "paths.h"
16   #include "resolu.h"
17  
18 + const char      stdin_name[] = "<stdin>";
19 +
20   const char      *cm_fmt_id[] = {
21                          "unknown", COLRFMT, CIEFMT,
22                          "float", "ascii", "double"
# Line 212 | Line 214 | CMATRIX *
214   cm_load(const char *inspec, int nrows, int ncols, int dtype)
215   {
216          const int       ROWINC = 2048;
215        FILE            *fp = stdin;
217          int             swap = 0;
218 +        FILE            *fp;
219          COLOR           scale;
220          CMATRIX         *cm;
221  
222 <        if (!inspec)
223 <                inspec = "<stdin>";
222 >        if (!inspec || !*inspec)
223 >                return(NULL);
224 >        if (inspec == stdin_name)
225 >                fp = stdin;
226          else if (inspec[0] == '!') {
227                  fp = popen(inspec+1, "r");
228                  if (!fp) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines