diff options
author | Kjell Wooding <kjell@cvs.openbsd.org> | 2005-10-11 01:08:54 +0000 |
---|---|---|
committer | Kjell Wooding <kjell@cvs.openbsd.org> | 2005-10-11 01:08:54 +0000 |
commit | 84d65e93af5f549a6a231de6c1463310a43308c9 (patch) | |
tree | 00c8eb5a04689436c97aa614aef8405e24426ae9 /usr.bin/mg/window.c | |
parent | 0ecee07d8fe56b1a0133782d5bd5870088af493a (diff) |
A while back, undo records were moved from the BUFFER struct to MGWIN.
This is nonsensical, and utterly broken if you are undo-ing across
multiple buffers. Change them back to being associated with the BUFFER
struct. (effectively, just revert the original change)
ok deraadt@
Diffstat (limited to 'usr.bin/mg/window.c')
-rw-r--r-- | usr.bin/mg/window.c | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/usr.bin/mg/window.c b/usr.bin/mg/window.c index 9331e54fe51..b56722605b1 100644 --- a/usr.bin/mg/window.c +++ b/usr.bin/mg/window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: window.c,v 1.17 2005/06/14 18:14:40 kjell Exp $ */ +/* $OpenBSD: window.c,v 1.18 2005/10/11 01:08:53 kjell Exp $ */ /* This file is in the public domain. */ @@ -27,27 +27,9 @@ new_window(BUFFER *bp) wp->w_wrapline = NULL; if (bp) bp->b_nwnd++; - LIST_INIT(&wp->w_undo); - wp->w_undoptr = NULL; - wp->w_undopos = 0; - return (wp); } -void -free_window(MGWIN *wp) -{ - struct undo_rec *rec, *next; - - rec = LIST_FIRST(&wp->w_undo); - while (rec != NULL) { - next = LIST_NEXT(rec, next); - free_undo_record(rec); - rec = next; - } - free(wp); -} - /* * Reposition dot in the current window to line "n". If the argument is * positive, it is that line. If it is negative it is that line from the @@ -177,7 +159,7 @@ onlywind(int f, int n) wp->w_bufp->b_markp = wp->w_markp; wp->w_bufp->b_marko = wp->w_marko; } - free_window(wp); + free(wp); } while (curwp->w_wndp != NULL) { wp = curwp->w_wndp; @@ -188,7 +170,7 @@ onlywind(int f, int n) wp->w_bufp->b_markp = wp->w_markp; wp->w_bufp->b_marko = wp->w_marko; } - free_window(wp); + free(wp); } lp = curwp->w_linep; i = curwp->w_toprow; @@ -425,7 +407,7 @@ delwind(int f, int n) nwp->w_wndp = wp->w_wndp; break; } - free_window(wp); + free(wp); return (TRUE); } |