aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2003-01-30 16:26:15 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2003-01-30 16:26:15 +0000
commit992994203ccd53c68c7a333a2726126df914fc2d (patch)
treef6f9385e811b459e2cfaf206d78a1701c73948fa
parentfix indent (diff)
downloadw3m-992994203ccd53c68c7a333a2726126df914fc2d.tar.gz
w3m-992994203ccd53c68c7a333a2726126df914fc2d.zip
[w3m-dev 03713] search with "$"
* search.c (forwardSearch): check l->next && l->next->bpos (backwardSearch): check l->size, l->next && l->next->bpos From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
-rw-r--r--ChangeLog8
-rw-r--r--search.c14
2 files changed, 16 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 74218a0..f15529a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2003-01-31 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
+ * [w3m-dev 03713] search with "$"
+ * search.c (forwardSearch): check l->next && l->next->bpos
+ (backwardSearch): check l->size, l->next && l->next->bpos
+
+2003-01-31 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
+
* [w3m-dev 03712] buf fix of LINE_INFO
* main.c (curlno): rewrite
@@ -6952,4 +6958,4 @@ a * [w3m-dev 03276] compile error on EWS4800
* release-0-2-1
* import w3m-0.2.1
-$Id: ChangeLog,v 1.726 2003/01/30 16:18:29 ukai Exp $
+$Id: ChangeLog,v 1.727 2003/01/30 16:26:15 ukai Exp $
diff --git a/search.c b/search.c
index 612b83e..f6ea92c 100644
--- a/search.c
+++ b/search.c
@@ -1,4 +1,4 @@
-/* $Id: search.c,v 1.26 2003/01/23 18:37:21 ukai Exp $ */
+/* $Id: search.c,v 1.27 2003/01/30 16:26:18 ukai Exp $ */
#include "fm.h"
#include "regex.h"
#include <signal.h>
@@ -121,7 +121,7 @@ forwardSearch(Buffer *buf, char *str)
if (pos < l->size && regexMatch(&l->lineBuf[pos], l->size - pos, 0) == 1) {
matchedPosition(&first, &last);
pos = first - l->lineBuf;
- while (pos >= l->len) {
+ while (pos >= l->len && l->next && l->next->bpos) {
pos -= l->len;
l = l->next;
}
@@ -162,7 +162,7 @@ forwardSearch(Buffer *buf, char *str)
/* exactly same match */
break;
pos = first - l->lineBuf;
- while (pos >= l->len) {
+ while (pos >= l->len && l->next && l->next->bpos) {
pos -= l->len;
l = l->next;
}
@@ -228,6 +228,8 @@ backwardSearch(Buffer *buf, char *str)
found = first;
found_last = last;
}
+ if (q - l->lineBuf >= l->size)
+ break;
#ifdef JP_CHARSET
if (l->propBuf[q - l->lineBuf] & PC_KANJI1)
q += 2;
@@ -239,7 +241,7 @@ backwardSearch(Buffer *buf, char *str)
}
if (found) {
pos = found - l->lineBuf;
- while (pos >= l->len) {
+ while (pos >= l->len && l->next && l->next->bpos) {
pos -= l->len;
l = l->next;
}
@@ -273,6 +275,8 @@ backwardSearch(Buffer *buf, char *str)
found = first;
found_last = last;
}
+ if (q - l->lineBuf >= l->size)
+ break;
#ifdef JP_CHARSET
if (l->propBuf[q - l->lineBuf] & PC_KANJI1)
q += 2;
@@ -282,7 +286,7 @@ backwardSearch(Buffer *buf, char *str)
}
if (found) {
pos = found - l->lineBuf;
- while (pos >= l->len) {
+ while (pos >= l->len && l->next && l->next->bpos) {
pos -= l->len;
l = l->next;
}