74 |
|
const char stdin_name[] = "<stdin>"; |
75 |
|
const char *f1name=NULL, *f2name=NULL; |
76 |
|
FILE *f1in=NULL, *f2in=NULL; |
77 |
+ |
|
78 |
|
/* running real differences */ |
79 |
|
double diff2sum = 0; |
80 |
|
int nsum = 0; |
139 |
|
/* skip whitespace at beginning */ |
140 |
|
while (isspace(*s1)) s1++; |
141 |
|
while (isspace(*s2)) s2++; |
141 |
– |
if (!strcmp(s1, s2)) /* quick check */ |
142 |
– |
return(1); |
142 |
|
while (*s1) { /* check each word */ |
143 |
< |
int inquote = *s1; |
143 |
> |
int inquote; |
144 |
> |
if (!*s2) /* unexpected EOL in s2? */ |
145 |
> |
return(0); |
146 |
> |
inquote = *s1; |
147 |
|
if ((inquote != '\'') & (inquote != '"')) |
148 |
|
inquote = 0; |
149 |
|
if (inquote) { /* quoted text must match exactly */ |
207 |
|
int kln, vln; |
208 |
|
int n; |
209 |
|
|
210 |
+ |
adv_linecnt(htp); /* side-effect is to count lines */ |
211 |
|
if (!isalpha(*val)) /* key must start line */ |
212 |
|
return(0); |
213 |
|
key = val++; |
238 |
|
if (tep->data) |
239 |
|
free(tep->data); |
240 |
|
tep->data = strcpy(malloc(vln+1), val); |
238 |
– |
adv_linecnt(htp); |
241 |
|
return(1); |
242 |
|
} |
243 |
|
|
318 |
|
char sbuf[32]; |
319 |
|
if (!fgets(sbuf, sizeof(sbuf), fin)) |
320 |
|
goto badeof; |
321 |
+ |
adv_linecnt(htp); /* for #?ID string */ |
322 |
|
if (report >= REP_WARN && strncmp(sbuf, "RADIANCE", 8)) { |
323 |
|
fputs(name, stderr); |
324 |
|
fputs(": warning - unexpected header ID: ", stderr); |
325 |
|
fputs(sbuf, stderr); |
326 |
|
} |
324 |
– |
adv_linecnt(htp); /* for #?ID string */ |
327 |
|
if (getheader(fin, setheadvar, htp) < 0) { |
328 |
|
fputs(name, stderr); |
329 |
|
fputs(": Unknown error reading header\n", stderr); |