aboutsummaryrefslogtreecommitdiffstats
path: root/search.c
diff options
context:
space:
mode:
authorAkinori Ito <aito@fw.ipsj.or.jp>2002-01-11 02:24:13 +0000
committerAkinori Ito <aito@fw.ipsj.or.jp>2002-01-11 02:24:13 +0000
commit687e4c8a22ead1eab6bcb29cb2ec30f04d69aa56 (patch)
treeb11b79117311a6da60778ccf63325ba004ab2fb5 /search.c
parent[w3m-dev 02818] (diff)
downloadw3m-687e4c8a22ead1eab6bcb29cb2ec30f04d69aa56.tar.gz
w3m-687e4c8a22ead1eab6bcb29cb2ec30f04d69aa56.zip
2002-01-11 Akinori Ito <aito@fw.ipsj.or.jp>
* [w3m-dev 02819] * regex.c (RegexMatch): loop condition changed (from < to <= ) * regex.c (regmatch_iter): end condition changed (from >= to >) * search.c (forwardSearch): next search fix
Diffstat (limited to '')
-rw-r--r--search.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/search.c b/search.c
index 9e54c85..2b04c34 100644
--- a/search.c
+++ b/search.c
@@ -1,4 +1,4 @@
-/* $Id: search.c,v 1.5 2001/12/23 14:44:00 ukai Exp $ */
+/* $Id: search.c,v 1.6 2002/01/11 02:24:13 a-ito Exp $ */
#include "fm.h"
#include "regex.h"
@@ -23,7 +23,8 @@ forwardSearch(Buffer *buf, char *str)
if (l->propBuf[pos] & PC_KANJI2)
pos++;
#endif
- if (regexMatch(&l->lineBuf[pos], l->len - pos, 0) == 1) {
+ if (pos < l->len &&
+ regexMatch(&l->lineBuf[pos], l->len - pos, 0) == 1) {
matchedPosition(&first, &last);
buf->pos = first - l->lineBuf;
arrangeCursor(buf);