diff options
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/mg/buffer.c | 3 | ||||
-rw-r--r-- | usr.bin/mg/def.h | 3 | ||||
-rw-r--r-- | usr.bin/mg/undo.c | 13 |
3 files changed, 5 insertions, 14 deletions
diff --git a/usr.bin/mg/buffer.c b/usr.bin/mg/buffer.c index bb1a4946705..0b16af1f737 100644 --- a/usr.bin/mg/buffer.c +++ b/usr.bin/mg/buffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: buffer.c,v 1.86 2012/11/03 14:51:41 haesbaert Exp $ */ +/* $OpenBSD: buffer.c,v 1.87 2012/11/06 18:04:10 florian Exp $ */ /* This file is in the public domain. */ @@ -543,7 +543,6 @@ bnew(const char *bname) bp->b_nmodes = defb_nmodes; TAILQ_INIT(&bp->b_undo); bp->b_undoptr = NULL; - memset(&bp->b_undopos, 0, sizeof(bp->b_undopos)); i = 0; do { bp->b_modes[i] = defb_modes[i]; diff --git a/usr.bin/mg/def.h b/usr.bin/mg/def.h index 7b03ca3cbbf..6a752d568b9 100644 --- a/usr.bin/mg/def.h +++ b/usr.bin/mg/def.h @@ -1,4 +1,4 @@ -/* $OpenBSD: def.h,v 1.128 2012/11/03 14:51:41 haesbaert Exp $ */ +/* $OpenBSD: def.h,v 1.129 2012/11/06 18:04:10 florian Exp $ */ /* This file is in the public domain. */ @@ -260,7 +260,6 @@ struct buffer { char b_cwd[NFILEN]; /* working directory */ struct fileinfo b_fi; /* File attributes */ struct undoq b_undo; /* Undo actions list */ - int b_undopos; /* Where we were during last undo */ struct undo_rec *b_undoptr; int b_dotline; /* Line number of dot */ int b_markline; /* Line number of mark */ diff --git a/usr.bin/mg/undo.c b/usr.bin/mg/undo.c index 1efd2a1851c..ba524e8f357 100644 --- a/usr.bin/mg/undo.c +++ b/usr.bin/mg/undo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: undo.c,v 1.50 2010/06/30 19:12:54 oga Exp $ */ +/* $OpenBSD: undo.c,v 1.51 2012/11/06 18:04:10 florian Exp $ */ /* * This file is in the public domain */ @@ -464,15 +464,13 @@ undo(int f, int n) struct undo_rec *ptr, *nptr; int done, rval; struct line *lp; - int offset, save, dot; + int offset, save; static int nulled = FALSE; int lineno; if (n < 0) return (FALSE); - dot = find_dot(curwp->w_dotp, curwp->w_doto); - ptr = curbp->b_undoptr; /* first invocation, make ptr point back to the top of the list */ @@ -573,13 +571,8 @@ undo(int f, int n) ewprintf("Undo!"); } - /* - * Record where we are. (we have to save our new position at the end - * since we change the dot when undoing....) - */ - curbp->b_undoptr = ptr; - curbp->b_undopos = find_dot(curwp->w_dotp, curwp->w_doto); + curbp->b_undoptr = ptr; return (rval); } |