Navigation Menu

Skip to content

Commit

Permalink
grn_pat: fix a bug that a pat is broken in deletion
Browse files Browse the repository at this point in the history
GitHub: #421
  • Loading branch information
s-yata committed Oct 28, 2015
1 parent 5c9e70b commit 0b96a19
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/pat.c
Expand Up @@ -1219,6 +1219,12 @@ _grn_pat_del(grn_ctx *ctx, grn_pat *pat, const char *key, uint32_t key_size, int
}
}
*p0 = otherside;
} else if ((!rn->lr[0] && rn->lr[1] == r) ||
(!rn->lr[1] && rn->lr[0] == r)) {
/* The output node has only a disabled self-loop. */
di->stat = DL_PHASE2;
di->d = r;
*p = 0;
} else {
/* The last transition (p) is not a self-loop. */
grn_pat_delinfo *ldi = NULL, *ddi = NULL;
Expand Down

0 comments on commit 0b96a19

Please sign in to comment.