appenditem(item, &lsubstr, &substrend);
}
if(lprefix) {
- if(matchend) {
+ if(matches) {
matchend->right = lprefix;
lprefix->left = matchend;
}
matchend = prefixend;
}
if(lsubstr) {
- if(matchend) {
+ if(matches) {
matchend->right = lsubstr;
lsubstr->left = matchend;
}