=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mg/undo.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- src/usr.bin/mg/undo.c 2002/02/21 04:21:05 1.5 +++ src/usr.bin/mg/undo.c 2002/02/21 17:36:12 1.6 @@ -1,4 +1,4 @@ -/* $OpenBSD: undo.c,v 1.5 2002/02/21 04:21:05 vincent Exp $ */ +/* $OpenBSD: undo.c,v 1.6 2002/02/21 17:36:12 vincent Exp $ */ /* * Copyright (c) 2002 Vincent Labrecque * All rights reserved. @@ -254,6 +254,7 @@ return TRUE; } } + /* * We couldn't reuse the last undo record, so prepare a new one */ @@ -407,7 +408,7 @@ */ undoaction++; - while (n-- > 0) { + while (n > 0) { rec = LIST_FIRST(&undo_list); if (rec == NULL) { ewprintf("Nothing to undo!"); @@ -418,7 +419,6 @@ LIST_REMOVE(rec, next); if (rec->type == BOUNDARY) { - n++; /* XXX */ continue; } @@ -448,6 +448,8 @@ } free_undo_record(rec); + + n--; } undoaction--;