375 if(e) { |
375 if(e) { |
376 return; |
376 return; |
377 } |
377 } |
378 PwdIndexEntry *newentry = malloc(sizeof(PwdIndexEntry)); |
378 PwdIndexEntry *newentry = malloc(sizeof(PwdIndexEntry)); |
379 newentry->id = id; |
379 newentry->id = id; |
380 if(locations) { |
380 if(cxListSize(locations) > 0) { |
381 newentry->locations = locations; |
381 newentry->locations = locations; |
382 cxListAdd(p->locations, newentry); |
382 cxListAdd(p->locations, newentry); |
383 } else { |
383 } else { |
384 newentry->locations = NULL; |
384 newentry->locations = NULL; |
385 cxListAdd(p->noloc, newentry); |
385 cxListAdd(p->noloc, newentry); |
|
386 cxListDestroy(locations); |
386 } |
387 } |
387 cxMapPut(p->index, cx_hash_key_str(id), newentry); |
388 cxMapPut(p->index, cx_hash_key_str(id), newentry); |
388 } |
389 } |
389 |
390 |
390 void write_index_entry(CxBuffer *out, PwdIndexEntry *e) { |
391 void write_index_entry(CxBuffer *out, PwdIndexEntry *e) { |