Index: net_len.c =================================================================== --- net_len.c (revision 35131) +++ net_len.c (revision 35132) @@ -297,6 +297,7 @@ static void remove_offender_from_open(pcb_find_t *fctx, pcb_any_obj_t *offender) { + parent_net_len_t *ctx = fctx->user_data; long n; /* remove anything from the open list that has contact with the offending object, @@ -304,6 +305,9 @@ for(n = 0; n < fctx->open.used; n++) { pcb_any_obj_t *o = fctx->open.array[n]; + if (ctx->ec->cfg_prefer_term && (o->term != NULL)) + continue; + if (pcb_intersect_obj_obj(fctx, offender, o)) { rnd_trace(" REMOVE1: #%ld (because of offender #%ld)\n", o->ID, offender->ID); vtp0_remove(&fctx->open, n, 1); @@ -320,6 +324,8 @@ for(n = 0; n < ctx->ec->tmplst.used; n++) { pcb_any_obj_t *o = ctx->ec->tmplst.array[n]; + if (ctx->ec->cfg_prefer_term && (o->term != NULL)) + continue; if ((o != dont_remove) && (pcb_intersect_obj_obj(fctx, offender, o))) { rnd_trace(" REMOVE2: #%ld\n", o->ID); vtp0_remove(&ctx->ec->tmplst, n, 1); Index: query_exec.h =================================================================== --- query_exec.h (revision 35131) +++ query_exec.h (revision 35132) @@ -42,6 +42,7 @@ pcb_qry_val_t all; /* a list of all objects */ pcb_query_iter_t *iter; /* current iterator */ vtp0_t autofree; + unsigned cfg_prefer_term:1; /* prefer ending in terminal */ int (*progress_cb)(pcb_qry_exec_t *ec, long at, long total); void *progress_ctx;