Fix #23461 and #23474: revision 31517 to simplify code made undo work

incorrect, BLI_findstring doesn't work when you need to loop over the
list backwards.
This commit is contained in:
Brecht Van Lommel 2010-08-25 16:01:30 +00:00
parent 141da38088
commit 0edde88d7a

@ -645,7 +645,11 @@ void BKE_undo_number(bContext *C, int nr)
/* go back to the last occurance of name in stack */
void BKE_undo_name(bContext *C, const char *name)
{
UndoElem *uel= BLI_findstring(&undobase, name, offsetof(UndoElem, name));
UndoElem *uel;
for(uel= undobase.last; uel; uel= uel->prev)
if(strcmp(name, uel->name)==0)
break;
if(uel && uel->prev) {
curundo= uel->prev;