=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mg/search.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- src/usr.bin/mg/search.c 2005/12/13 06:01:27 1.27 +++ src/usr.bin/mg/search.c 2006/02/03 13:57:03 1.28 @@ -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 @@ 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;