Revision: 45544
          http://brlcad.svn.sourceforge.net/brlcad/?rev=45544&view=rev
Author:   brlcad
Date:     2011-07-19 20:19:54 +0000 (Tue, 19 Jul 2011)

Log Message:
-----------
now that the ged struct is fully initialized during ged_init(), it exposed a 
bug where code wasn't initializing the output handler properly after opening a 
database.  this restores rt command output.

Modified Paths:
--------------
    brlcad/trunk/NEWS
    brlcad/trunk/src/mged/mged.c
    brlcad/trunk/src/mged/setup.c

Modified: brlcad/trunk/NEWS
===================================================================
--- brlcad/trunk/NEWS   2011-07-19 20:09:05 UTC (rev 45543)
+++ brlcad/trunk/NEWS   2011-07-19 20:19:54 UTC (rev 45544)
@@ -13,6 +13,7 @@
 --- 2011-07-XX  Release 7.20.4                                     ---
 ----------------------------------------------------------------------
 
+* restored mged 'rt' command output to console window - Sean Morrison
 * fixed infinite loop bug plotting NURBS wireframes - Sean Morrison
 * added ringworld proc-db - Erik Greenwald
 * fixed mged Manual page item in help menu - Brandon Hinesley

Modified: brlcad/trunk/src/mged/mged.c
===================================================================
--- brlcad/trunk/src/mged/mged.c        2011-07-19 20:09:05 UTC (rev 45543)
+++ brlcad/trunk/src/mged/mged.c        2011-07-19 20:19:54 UTC (rev 45544)
@@ -2567,6 +2567,22 @@
 }
 
 
+static void
+mged_output_handler(struct ged *UNUSED(gp), char *line)
+{
+    if (line)
+       bu_log("%s", line);
+}
+
+
+static void
+mged_refresh_handler(void *UNUSED(clientdata))
+{
+    view_state->vs_flag = 1;
+    refresh();
+}
+
+
 /**
  * F _ O P E N D B
  *
@@ -2819,6 +2835,8 @@
     /* initialize a separate wdbp for libged to manage */
     ged_wdbp = wdb_dbopen(dbip, RT_WDB_TYPE_DB_DISK);
     GED_INIT(gedp, ged_wdbp);
+    gedp->ged_output_handler = mged_output_handler;
+    gedp->ged_refresh_handler = mged_refresh_handler;
 
     /* increment use count for gedp db instance */
     (void)db_clone_dbi(dbip, NULL);

Modified: brlcad/trunk/src/mged/setup.c
===================================================================
--- brlcad/trunk/src/mged/setup.c       2011-07-19 20:09:05 UTC (rev 45543)
+++ brlcad/trunk/src/mged/setup.c       2011-07-19 20:19:54 UTC (rev 45544)
@@ -445,22 +445,6 @@
 }
 
 
-static void
-mged_output_handler(struct ged *UNUSED(gp), char *line)
-{
-    if (line)
-       bu_log("%s", line);
-}
-
-
-static void
-mged_refresh_handler(void *UNUSED(clientdata))
-{
-    view_state->vs_flag = 1;
-    refresh();
-}
-
-
 /*
  * Initialize mged, configure the path, set up the tcl interpreter.
  */
@@ -595,9 +579,6 @@
     }
     GED_INIT(gedp, NULL);
 
-    gedp->ged_output_handler = mged_output_handler;
-    gedp->ged_refresh_handler = mged_refresh_handler;
-
     /* register commands */
     cmd_setup();
 


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

------------------------------------------------------------------------------
Magic Quadrant for Content-Aware Data Loss Prevention
Research study explores the data loss prevention market. Includes in-depth
analysis on the changes within the DLP market, and the criteria used to
evaluate the strengths and weaknesses of these DLP solutions.
http://www.accelacomm.com/jaw/sfnl/114/51385063/
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to