sbase

suckless unix tools
git clone git://git.2f30.org/sbase.git
Log | Files | Refs | README | LICENSE

commit 61c3deea07fce926c6c48ced9160e96d734cc122
parent d7c1a99cb7d385e737c6270046c94fe1b453998d
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Thu Dec 31 19:35:26 +0000

ed: Fix infinite recursion to undo()

Diffstat:
ed.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/ed.c b/ed.c @@ -282,7 +282,7 @@ undo(void) struct link *p; if (udata.nr == 0) - error("nothing to undo"); + return; for (p = &udata.vec[udata.nr-1]; udata.nr--; --p) { zero[p->from1].next = p->to1; zero[p->from2].prev = p->to2; @@ -1101,6 +1101,8 @@ repeat: if (nlines > 0) goto bad_address; chkprint(1); + if (udata.nr == 0) + error("nothing to undo"); undo(); break; case 's':