Revision: 56468
          http://sourceforge.net/p/brlcad/code/56468
Author:   starseeker
Date:     2013-08-02 14:16:15 +0000 (Fri, 02 Aug 2013)
Log Message:
-----------
Have rtweight handle outfp locally based on the options.  Not sure if this is 
the 'correct' fix given the problem was somehow introduced in r56243 (not sure 
why yet) but it does seem to make sense and gets regress passing again.

Revision Links:
--------------
    http://sourceforge.net/p/brlcad/code/56243

Modified Paths:
--------------
    brlcad/trunk/src/rt/viewweight.c

Modified: brlcad/trunk/src/rt/viewweight.c
===================================================================
--- brlcad/trunk/src/rt/viewweight.c    2013-08-02 14:07:57 UTC (rev 56467)
+++ brlcad/trunk/src/rt/viewweight.c    2013-08-02 14:16:15 UTC (rev 56468)
@@ -203,6 +203,9 @@
     if (!minus_o) {
        outfp = stdout;
        output_is_binary = 0;
+    } else {
+       if (outfp == NULL && outputfile != NULL && strlen(outputfile) > 0)
+           outfp = fopen(outputfile, "w");
     }
 
     for (i = 1; i < MAXMATLS; i++) {
@@ -223,6 +226,9 @@
        if ((densityfp = fopen(densityfile, "r")) == (FILE *)0) {
            bu_log("Unable to load density file \"%s\" for reading\n", 
densityfile);
            perror(densityfile);
+           if (minus_o) {
+               fclose(outfp);
+           }
            bu_exit(-1, NULL);
        }
     }
@@ -267,6 +273,9 @@
     ap->a_miss = miss;
     ap->a_overlap = overlap;
     ap->a_onehit = 0;
+    if (minus_o) {
+       fclose(outfp);
+    }
 
     return 0;          /* no framebuffer needed */
 }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to