--- ray/src/util/rad.c 2015/05/27 13:29:57 2.114 +++ ray/src/util/rad.c 2015/05/27 14:26:04 2.117 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rad.c,v 2.114 2015/05/27 13:29:57 greg Exp $"; +static const char RCSid[] = "$Id: rad.c,v 2.117 2015/05/27 14:26:04 greg Exp $"; #endif /* * Executive program for oconv, rpict and pfilt @@ -657,12 +657,16 @@ mkpmap(void) /* run mkpmap if indicated */ badvalue(REPORT); } if (pgmapname != NULL && pgmapdate < oct1date) { + if (pgmapdate) + rmfile(pgmapname); cp = addarg(cp, "-apg"); addarg(cp, vval(PGMAP)); cp = sskip(sskip(cp)); /* remove any bandwidth */ *cp = '\0'; } if (pcmapname != NULL && pcmapdate < oct1date) { + if (pcmapdate) + rmfile(pcmapname); cp = addarg(cp, "-apc"); addarg(cp, vval(PCMAP)); cp = sskip(sskip(cp)); /* remove any bandwidth */ @@ -672,9 +676,9 @@ mkpmap(void) /* run mkpmap if indicated */ if (runcom(combuf)) { fprintf(stderr, "%s: error running %s\n", progname, c_mkpmap); - if (pgmapname != NULL) + if (pgmapname != NULL && pgmapdate < oct1date) unlink(pgmapname); - if (pcmapname != NULL) + if (pcmapname != NULL && pcmapdate < oct1date) unlink(pcmapname); quit(1); }