Permalink
Browse files

Fixed bug in copyAffixNode (ommited the 'val' field, so the FindAffix…

…es failed).
  • Loading branch information...
1 parent 72fb026 commit dfc0e451e139d496af620139cbeba18e967487dd @tvondra committed Jan 4, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/shared_ispell.c
View
6 src/shared_ispell.c
@@ -544,8 +544,9 @@ AFFIX * copyAffix(AFFIX * affix) {
if (copy->isregis) {
copy->reg.regis.node = copyRegisNode(copy->reg.regis.node);
- } else {
+ } else if (! copy->issimple) {
// FIXME handle the regex_t properly (copy the strings etc)
+ elog(WARNING, "skipping regex_t");
}
return copy;
@@ -563,14 +564,13 @@ AffixNode * copyAffixNode(AffixNode * node) {
}
copy = (AffixNode *)shalloc(offsetof(AffixNode,data) + sizeof(AffixNodeData) * node->length);
- copy->isvoid = node->isvoid;
- copy->length = node->length;
memcpy(copy, node, offsetof(SPNode,data) + sizeof(SPNodeData) * node->length);
for (i = 0; i < node->length; i++) {
copy->data[i].node = copyAffixNode(node->data[i].node);
+ copy->data[i].val = node->data[i].val;
copy->data[i].naff = node->data[i].naff;
copy->data[i].aff = (AFFIX**)shalloc(sizeof(AFFIX*) * node->data[i].naff);
memset(copy->data[i].aff, 0, sizeof(AFFIX*) * node->data[i].naff);

0 comments on commit dfc0e45

Please sign in to comment.