Revision: 45733
          http://brlcad.svn.sourceforge.net/brlcad/?rev=45733&view=rev
Author:   bhinesley
Date:     2011-07-30 00:09:00 +0000 (Sat, 30 Jul 2011)

Log Message:
-----------
Fixed crash due to use of uninitialized pointers; command union wasn't being 
initialized early enough.

Modified Paths:
--------------
    brlcad/trunk/src/libged/edit.c

Modified: brlcad/trunk/src/libged/edit.c
===================================================================
--- brlcad/trunk/src/libged/edit.c      2011-07-29 19:03:17 UTC (rev 45732)
+++ brlcad/trunk/src/libged/edit.c      2011-07-30 00:09:00 UTC (rev 45733)
@@ -1710,7 +1710,7 @@
 /* FIXME: usage/help messages for subcommands should contain the name
  * of the 'parent' command when necessary: i.e.: 'edit translate'
  * rather than just 'translate'. Also, the help option of subcommands
- * is not displayed in usage; it should display when command is called
+ * is not displayed properly; it should display when command is called
  * directly, i.e. 'translate', but not 'edit translate' */
 
     for (i = 0; edit_cmds[i].name; ++i) {
@@ -1730,6 +1730,9 @@
        }
     }
 
+    /* now that the cmd type is known, we can init the subcmd args */
+    subcmd.cmd->init(&subcmd);
+
     if (subcmd_name == cmd_name) { /* ptr cmp */
        /* command name is serving as the subcommand */
        --argc;
@@ -1992,7 +1995,7 @@
     /* remove command line arguments, and let command specific
      * funtions reattach them in the proper locations */
     cur_arg = subcmd.cmd_line.args;
-    subcmd.cmd->init(&subcmd);
+    subcmd.cmd_line.args = (struct edit_arg *)NULL;
     if (subcmd.cmd->add_args(gedp, &subcmd, cur_arg, GED_ERROR) == GED_ERROR)
        return GED_ERROR;
 


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

------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to