--- ray/src/util/dctimestep.c 2011/04/15 18:43:57 2.17 +++ ray/src/util/dctimestep.c 2012/02/21 20:09:25 2.19 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: dctimestep.c,v 2.17 2011/04/15 18:43:57 greg Exp $"; +static const char RCSid[] = "$Id: dctimestep.c,v 2.19 2012/02/21 20:09:25 greg Exp $"; #endif /* * Compute time-step result using Daylight Coefficient method. @@ -382,7 +382,8 @@ sum_images(const char *fspec, const CMATRIX *cv, FILE int dt, xr, yr; COLORV *psp; /* check for zero */ - if ((scv[RED] == 0) & (scv[GRN] == 0) & (scv[BLU] == 0)) + if ((scv[RED] == 0) & (scv[GRN] == 0) & (scv[BLU] == 0) && + (myDT != DTfromHeader) | (i < cv->nrows-1)) continue; /* open next picture */ sprintf(fname, fspec, i); @@ -444,16 +445,22 @@ sum_images(const char *fspec, const CMATRIX *cv, FILE static int hasNumberFormat(const char *s) { - while (*s && *s != '%') - s++; - if (!*s) - return(0); - do - ++s; - while (isdigit(*s)); - - return((*s == 'd') | (*s == 'i') | (*s == 'o') | - (*s == 'x') | (*s == 'X')); + while (*s) { + while (*s != '%') + if (!*s++) + return(0); + if (*++s == '%') { /* ignore "%%" */ + ++s; + continue; + } + while (isdigit(*s)) /* field length */ + ++s; + /* field we'll use? */ + if ((*s == 'd') | (*s == 'i') | (*s == 'o') | + (*s == 'x') | (*s == 'X')) + return(1); + } + return(0); /* didn't find one */ } int