summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2006-02-03 13:57:04 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2006-02-03 13:57:04 +0000
commit0d744d54097bc87cec20b8d48fc7368713c6caf5 (patch)
tree677a4c76cb4a9ed288c731ce2292b00ffaad5f25
parentd672bee016150a61990cf94ec1d8a2a808612fc5 (diff)
Fix off by one ocurring if ^W immediate follows ^S; testing marc@;
ok kjell@; PR 4991
-rw-r--r--usr.bin/mg/search.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/mg/search.c b/usr.bin/mg/search.c
index 42da2f5db0d..33a0f0e88dd 100644
--- a/usr.bin/mg/search.c
+++ b/usr.bin/mg/search.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: search.c,v 1.27 2005/12/13 06:01:27 kjell Exp $ */
+/* $OpenBSD: search.c,v 1.28 2006/02/03 13:57:03 otto Exp $ */
/* This file is in the public domain. */
@@ -285,6 +285,8 @@ isearch(int dir)
clp = curwp->w_dotp;
cbo = curwp->w_doto;
firstc = 1;
+ if (pptr == -1)
+ pptr = 0;
if (dir == SRCH_BACK) {
/* when isearching backwards, cbo is the start of the pattern */
cbo += pptr;