Attempts to rename by case only would fail when there are more than
one ambiguous matches. The list of data nodes would be corrupted
and future tree manipulations could result in a crash.
(cherry picked from commit
3c216378cba651dcb6519d7e615be37b534b56c8)
* options. So we must determine if any of the next nodes
* are the one we are looking for.
*/
- Nptr dataNode = newNode;
+ Nptr prev = newNode;
while ( next ) {
if (!comparekeys(B)(getfunkey(B), getdatakey(next), EXACT_MATCH)) {
/* we found the one to delete */
- getdatanext(dataNode) = getdatanext(next);
+ getdatanext(prev) = getdatanext(next);
putFreeNode(B, next);
+ break;
}
+ prev = next;
+ next = getdatanext(next);
}
/* do not delete the key */