--- ray/src/util/rfluxmtx.c 2015/07/22 04:23:27 2.30 +++ ray/src/util/rfluxmtx.c 2015/12/04 22:16:18 2.32 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rfluxmtx.c,v 2.30 2015/07/22 04:23:27 greg Exp $"; +static const char RCSid[] = "$Id: rfluxmtx.c,v 2.32 2015/12/04 22:16:18 greg Exp $"; #endif /* * Calculate flux transfer matrix or matrices using rcontrib @@ -329,6 +329,7 @@ parse_params(PARAMS *p, char *pargs) { char *cp = pargs; int nparams = 0; + int quot; int i; for ( ; ; ) { @@ -365,14 +366,23 @@ parse_params(PARAMS *p, char *pargs) case 'o': if (*cp++ != '=') break; + quot = 0; + if ((*cp == '"') | (*cp == '\'')) + quot = *cp++; i = 0; - while (*cp && !isspace(*cp++)) - i++; + while (*cp && (quot ? (*cp != quot) : !isspace(*cp))) { + i++; cp++; + } if (!i) break; - *--cp = '\0'; + if (!*cp) { + if (quot) + break; + cp[1] = '\0'; + } + *cp = '\0'; p->outfn = savqstr(cp-i); - *cp++ = ' '; + *cp++ = quot ? quot : ' '; ++nparams; continue; case ' ': @@ -685,7 +695,7 @@ sample_origin(PARAMS *p, FVECT orig, const FVECT rdir, /* special case for lone surface */ if (p->nsurfs == 1) { sp = p->slist; - if (DOT(sp->snrm, rdir) >= -FTINY) { + if (DOT(sp->snrm, rdir) >= FTINY) { fprintf(stderr, "%s: internal - sample behind sender '%s'\n", progname, sp->sname);