Revision: 71766 http://sourceforge.net/p/brlcad/code/71766 Author: starseeker Date: 2018-09-20 16:34:33 +0000 (Thu, 20 Sep 2018) Log Message: ----------- Fix a red command regression introduced in r70751 - with the removal of REG_STARTEND the non-whitespace check after the comb tag was not limited to checking between the comb tag itself and the first legitimate comb instance entry. This unconstrained match resulted in its matching with and reporting the comb entry itself as erroneous content, which in turn resulted in all red operations failing. Surprisingly this didn't seem to break our regress-red test reliably, although it did break on some systems... perhaps (since we were still setting the rm_so and rm_eo values) whether the regexec matching scope was unbounded or not ended up being implementation dependent?
Modified Paths: -------------- brlcad/trunk/src/libged/red.c Modified: brlcad/trunk/src/libged/red.c =================================================================== --- brlcad/trunk/src/libged/red.c 2018-09-20 14:52:49 UTC (rev 71765) +++ brlcad/trunk/src/libged/red.c 2018-09-20 16:34:33 UTC (rev 71766) @@ -395,11 +395,10 @@ ret = regexec(&combtree_op_regex, currptr, combtree_op_regex.re_nsub, result_locations, 0); if (ret == 0) { /* matched */ + int cstart = result_locations[0].rm_so; /* Check for non-whitespace garbage between first operator and start of comb tree definition */ - result_locations[0].rm_eo = result_locations[0].rm_so; - result_locations[0].rm_so = 0; - if (regexec(&nonwhitespace_regex, currptr, nonwhitespace_regex.re_nsub, result_locations, 0) == 0) { + if ((regexec(&nonwhitespace_regex, currptr, nonwhitespace_regex.re_nsub, result_locations, 0) == 0) && result_locations[0].rm_so < cstart) { /* matched */ bu_vls_printf(gedp->ged_result_str, "Saw something other than comb tree entries after comb tree tag - error!\n"); 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