1219,221c219 2< tp1 = get_term_ptr(); 3< fp3->terms = tp1; 4< tp1->term = t; 5--- 6> fp3->terms = flist_insert(NULL, t); 7235,256c233 8< 9< tp1 = fp1->terms; 10< tp2 = NULL; 11< /* keep list sorted, decreasing addresses */ 12< while (tp1 != NULL && tp1->term->fpa_id > t->fpa_id) { 13< tp2 = tp1; 14< tp1 = tp1->next; 15< } 16< if (tp1 != NULL && tp1->term == t) 17< Stats[FPA_OVERLOADS]++; /* term already in list */ 18< else { 19< tp3 = get_term_ptr(); 20< tp3->term = t; 21< if (tp2 == NULL) { /* insert at beginning */ 22< tp3->next = fp1->terms; 23< fp1->terms = tp3; 24< } 25< else { /* insert after tp2 */ 26< tp3->next = tp1; 27< tp2->next = tp3; 28< } 29< } 30--- 31> fp1->terms = flist_insert(fp1->terms, t); 32291,314c268,275 33< tp1 = fp1->terms; 34< tp2 = NULL; 35< /* list is sorted, decreasing addresses */ 36< while (tp1 != NULL && tp1->term->fpa_id > t->fpa_id) { 37< tp2 = tp1; 38< tp1 = tp1->next; 39< } 40< if (tp1 == NULL || tp1->term != t) 41< Stats[FPA_UNDERLOADS]++; /* term not found in list */ 42< else { 43< if (tp2 == NULL) { /* delete from beginning */ 44< fp1->terms = tp1->next; 45< if (fp1->terms == NULL) { /* delete fpa_head also */ 46< if (fp2 == NULL) 47< index->table[hashval] = fp1->next; 48< else 49< fp2->next = fp1->next; 50< free_fpa_head(fp1); 51< /* don't worry about fp1->path; let it be lost forever */ 52< } 53< } 54< else /* delete */ 55< tp2->next = tp1->next; 56< free_term_ptr(tp1); 57--- 58> fp1->terms = flist_delete(fp1->terms, t); 59> if (fp1->terms == NULL) { /* delete fpa_head also */ 60> if (fp2 == NULL) 61> index->table[hashval] = fp1->next; 62> else 63> fp2->next = fp1->next; 64> free_fpa_head(fp1); 65> /* don't worry about fp1->path; let it be lost forever */ 66438c399 67< pp->terms = fp->terms; 68--- 69> pp->position = first_fpos(fp->terms); 70632a594 71> 72634,637c596,601 73< tp = n->terms; /* fpa lists: terms have decreasing addresses */ 74< while (tp != NULL && max != 0 && tp->term->fpa_id > max) 75< tp = tp->next; 76< if (tp == NULL) { 77--- 78> struct term *t = FTERM(n->position); 79> while (t != NULL && max != 0 && t->fpa_id > max) { 80> n->position = next_fpos(n->position); 81> t = FTERM(n->position); 82> } 83> if (t == NULL) { 84642,643c606,607 85< n->terms = tp->next; 86< return(tp->term); 87--- 88> n->position = next_fpos(n->position); 89> return(t); 90745c709 91< p2->terms = h->terms; 92--- 93> p2->position = first_fpos(h->terms); 94791d754 95< struct term_ptr *tp; 96798a762,763 97> struct fposition fpos; 98> struct term *t; 99800,801c765,767 100< tp = f->terms; 101< while (tp != NULL) { 102--- 103> fpos = first_fpos(f->terms); 104> t = FTERM(fpos); 105> while (t != NULL) { 106803,804c769,771 107< print_term(fp, tp->term); 108< tp = tp->next; 109--- 110> print_term(fp, t); 111> fpos = first_fpos(f->terms); 112> t = FTERM(fpos); 113935a903 114> 115