aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ChangeLog9
-rw-r--r--regex.c6
-rw-r--r--search.c5
3 files changed, 14 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 30019d7..74adb27 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+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
+
2002-01-11 Fumitoshi UKAI <ukai@debian.or.jp>
* [w3m-dev 02818]
@@ -1842,4 +1849,4 @@
* release-0-2-1
* import w3m-0.2.1
-$Id: ChangeLog,v 1.206 2002/01/10 16:11:32 ukai Exp $
+$Id: ChangeLog,v 1.207 2002/01/11 02:24:13 a-ito Exp $
diff --git a/regex.c b/regex.c
index 05a964c..4795f24 100644
--- a/regex.c
+++ b/regex.c
@@ -1,4 +1,4 @@
-/* $Id: regex.c,v 1.9 2002/01/10 16:11:32 ukai Exp $ */
+/* $Id: regex.c,v 1.10 2002/01/11 02:24:13 a-ito Exp $ */
/*
* regex: Regular expression pattern match library
*
@@ -265,7 +265,7 @@ RegexMatch(Regex *re, char *str, int len, int firstp)
len = strlen(str);
re->position = NULL;
ep = str + len;
- for (p = str; p < ep; p++) {
+ for (p = str; p <= ep; p++) {
lpos = NULL;
re->lposition = NULL;
for (r = re; r != NULL; r = r->alt_regex) {
@@ -554,7 +554,7 @@ regmatch_iter(struct MatchingContext1 *c,
c->re++;
c->firstp = 0;
}
- if (c->str >= c->end_p) {
+ if (c->str > c->end_p) {
return 0;
}
}
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);