summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvincent <vincent@openbsd.org>2003-11-09 01:20:32 +0000
committervincent <vincent@openbsd.org>2003-11-09 01:20:32 +0000
commitf3cf91de1e06fcfa595ff134f6b06b8eb1dd3c9a (patch)
treecd0607ed147277da70734461b4bb16c984888628
parentremove the only use of the hackish undo_add_custom function. (diff)
downloadwireguard-openbsd-f3cf91de1e06fcfa595ff134f6b06b8eb1dd3c9a.tar.xz
wireguard-openbsd-f3cf91de1e06fcfa595ff134f6b06b8eb1dd3c9a.zip
fix a bug i introduced in -r1.19, we should still use the current buffer
to test for the end of circular lists.
-rw-r--r--usr.bin/mg/undo.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/mg/undo.c b/usr.bin/mg/undo.c
index 0594d1fcb99..6dea86372ce 100644
--- a/usr.bin/mg/undo.c
+++ b/usr.bin/mg/undo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: undo.c,v 1.20 2003/11/09 01:11:14 vincent Exp $ */
+/* $OpenBSD: undo.c,v 1.21 2003/11/09 01:20:32 vincent Exp $ */
/*
* Copyright (c) 2002 Vincent Labrecque
* All rights reserved.
@@ -71,9 +71,9 @@ find_absolute_dot(LINE *lp, int off)
int count = 0;
LINE *p;
- for (p = curwp->w_linep; p != lp; p = lforw(p)) {
+ for (p = curbp->b_linep; p != lp; p = lforw(p)) {
if (count != 0) {
- if (p == curwp->w_linep) {
+ if (p == curbp->b_linep) {
ewprintf("Error: Undo stuff called with a"
"nonexistent line");
return (FALSE);
@@ -91,10 +91,10 @@ find_line_offset(int pos, LINE **olp, int *offset)
{
LINE *p;
- p = curwp->w_linep;
+ p = curbp->b_linep;
while (pos > llength(p)) {
pos -= llength(p) + 1;
- if ((p = lforw(p)) == curwp->w_linep) {
+ if ((p = lforw(p)) == curbp->b_linep) {
*olp = NULL;
*offset = 0;
return (FALSE);