Revision: 48446
          http://brlcad.svn.sourceforge.net/brlcad/?rev=48446&view=rev
Author:   bob1961
Date:     2012-01-11 22:08:10 +0000 (Wed, 11 Jan 2012)
Log Message:
-----------
Need to check gedp for NULL up front. If a database has not been opened return 
without complaint. Note - the command and it's args are in ged_result_str.

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

Modified: brlcad/trunk/src/libged/glob.c
===================================================================
--- brlcad/trunk/src/libged/glob.c      2012-01-11 22:05:47 UTC (rev 48445)
+++ brlcad/trunk/src/libged/glob.c      2012-01-11 22:08:10 UTC (rev 48446)
@@ -94,6 +94,10 @@
     struct bu_vls src;
     static const char *usage = "expression";
 
+    /* Silently return */
+    if (gedp == GED_NULL)
+       return GED_ERROR;
+
     /* initialize result */
     bu_vls_trunc(gedp->ged_result_str, 0);
 
@@ -158,7 +162,10 @@
           it to the database. */
 
        if (regexp) {
-           GED_CHECK_DATABASE_OPEN(gedp, GED_OK);
+           /* No database to match against, so return. */
+           if (gedp->ged_wdbp == RT_WDB_NULL || gedp->ged_wdbp->dbip == 
DBI_NULL)
+               return GED_OK;
+
            bu_vls_trunc(&temp, 0);
            if (db_regexp_match_all(&temp, gedp->ged_wdbp->dbip,
                                    bu_vls_addr(&word)) == 0) {

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


------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to