- }
- else if (zi->reg->isamb)
- {
- int trunc_limit = atoi(res_get_def(zi->res, "trunclimit", "10000"));
- if (no == 1)
- return rsisamb_create(rset_nmem,kctrl, scope,
- zi->reg->isamb, *isam_p, termid);
- else if (no < trunc_limit)
- {
- RSET r;
- RSET *rsets = xmalloc(no*sizeof(RSET)); /* use nmem! */
- int i;
- for (i = 0; i<no; i++)
- rsets[i] = rsisamb_create(rset_nmem, kctrl, scope,
- zi->reg->isamb, isam_p[i], termid);
- r = rsmulti_or_create( rset_nmem, kctrl, scope, no, rsets);
- xfree(rsets);
- return r;
- }
- fprintf(stderr, "Using rset_trunc_r limit=%d\n", trunc_limit);
- qsort(isam_p, no, sizeof(*isam_p), isamc_trunc_cmp);
- }