Revision: 76190 http://sourceforge.net/p/brlcad/code/76190 Author: brlcad Date: 2020-06-24 06:47:35 +0000 (Wed, 24 Jun 2020) Log Message: ----------- since the error persisted for years, detect corrupt .mgedrc so a more meaningful error can be reported.
Modified Paths: -------------- brlcad/trunk/src/libged/qray.c Modified: brlcad/trunk/src/libged/qray.c =================================================================== --- brlcad/trunk/src/libged/qray.c 2020-06-24 04:56:13 UTC (rev 76189) +++ brlcad/trunk/src/libged/qray.c 2020-06-24 06:47:35 UTC (rev 76190) @@ -124,7 +124,8 @@ int argc, const char *argv[]) { - if (!gedp || argc <= 0 || !argv) return GED_ERROR; + if (!gedp || argc <= 0 || !argv) + return GED_ERROR; GED_CHECK_ARGC_GT_0(gedp, argc, GED_ERROR); /* initialize result */ @@ -136,6 +137,22 @@ return GED_HELP; } + /* catch bug introduced pre 7.26.0 where .mgedrc ends up with qray + * lines containting "A database is not open!". we detect to + * report a more meaningful error message. + */ + if ((argc >= 4 + && BU_STR_EQUAL(argv[3], "A database is not open!")) + || (argc == 7 + && BU_STR_EQUAL(argv[2], "A") + && BU_STR_EQUAL(argv[3], "database") + && BU_STR_EQUAL(argv[4], "is") + && BU_STR_EQUAL(argv[5], "not") + && BU_STR_EQUAL(argv[6], "open!"))) { + bu_vls_printf(gedp->ged_result_str, "WARNING: Corrupt qray line encountered.\n"); + return GED_ERROR; + } + if (argc > 6) { usage(gedp, argv[0]); return GED_ERROR; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ BRL-CAD Source Commits mailing list brlcad-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/brlcad-commits