| 219 |
|
COLOR scale; |
| 220 |
|
CMATRIX *cm; |
| 221 |
|
|
| 222 |
< |
if (!inspec || !*inspec) |
| 222 |
> |
if (!inspec) |
| 223 |
> |
inspec = stdin_name; |
| 224 |
> |
else if (!*inspec) |
| 225 |
|
return(NULL); |
| 226 |
< |
if (inspec == stdin_name) |
| 226 |
> |
if (inspec == stdin_name) { /* reading from stdin? */ |
| 227 |
|
fp = stdin; |
| 228 |
< |
else if (inspec[0] == '!') { |
| 228 |
> |
} else if (inspec[0] == '!') { |
| 229 |
|
fp = popen(inspec+1, "r"); |
| 230 |
|
if (!fp) { |
| 231 |
|
sprintf(errmsg, "cannot start command '%s'", inspec); |
| 240 |
|
#endif |
| 241 |
|
if (dtype != DTascii) |
| 242 |
|
SET_FILE_BINARY(fp); /* doesn't really work */ |
| 243 |
< |
if (!dtype | !ncols) { /* expecting header? */ |
| 243 |
> |
if (!dtype | !nrows | !ncols) { /* expecting header? */ |
| 244 |
|
char *err = cm_getheader(&dtype, &nrows, &ncols, &swap, scale, fp); |
| 245 |
|
if (err) |
| 246 |
|
error(USER, err); |
| 247 |
|
} |
| 248 |
< |
if (ncols <= 0 && !fscnresolu(&ncols, &nrows, fp)) |
| 249 |
< |
error(USER, "unspecified number of columns"); |
| 248 |
> |
if (!nrows | !ncols && !fscnresolu(&ncols, &nrows, fp)) |
| 249 |
> |
error(USER, "unspecified matrix size"); |
| 250 |
|
switch (dtype) { |
| 251 |
|
case DTascii: |
| 252 |
|
case DTfloat: |