Re: (fwd) Re: Tin issue
Dennis Preiser <[email protected]> Tue, 21 Feb 2017 18:18:59 +0100
| Newsgroups | gmane.network.tin.devel |
|---|---|
| Message-ID | <[email protected]> |
--xHFwDpU9dbj6ez1V
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
On Mon, Feb 20, 2017 at 09:26:22PM +0100, Dennis Preiser wrote:
>>> > > On Sun, Feb 19, 2017 at 11:37:32AM +0100, Walter Alejandro Iglesias wrote:
>>> > > > 1. An issue (bug?) I found. In the article view, search (/) and 'repeat
>>> > > > last search' (\) get stalled in the first occurrence. I have to
>>> > > > scroll the page till the first finding is hidden off the buffer to be
>>> > > > able to go forward to the next occurrence.
> I had no time to look into this but I can reproduce it with wildcard=0
> in tinrc. (linked against ncursesw)
In case of 'wildcard=0' we reset both search offsets to zero at the
beginning of wildmat.c:wildmatpos. That's the reason why each subsequent
search starts at the beginning of the current line and finds the same
occurence as the last search.
The attached patch uses the second offset of the previous search to skip
over the already processed part of the current line.
Dennis
--xHFwDpU9dbj6ez1V
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="2017-02-21.diff"
diff -urp tin-2.4.1_r3/src/wildmat.c tin-2.4.1_r4/src/wildmat.c
--- tin-2.4.1_r3/src/wildmat.c 2016-10-12 17:28:02.000000000 +0200
+++ tin-2.4.1_r4/src/wildmat.c 2017-02-21 17:27:28.000000000 +0100
@@ -169,7 +169,7 @@ wildmatpos(
int srch_offsets_size)
{
char *txt, *t, *px;
- int i;
+ int i, prev_offset = srch_offsets[1];
t_bool ret = FALSE;
if (srch_offsets_size >= 2)
@@ -199,7 +199,7 @@ wildmatpos(
/* remove the leading '*' */
px = my_strdup(p + 1);
- for (t = txt; *t; t++)
+ for (t = txt + prev_offset; *t; t++)
if ((ret = (DoMatch(t, px))) == TRUE) {
/* remove the trailing '*' */
px[strlen(px) - 1] = '\0';
--xHFwDpU9dbj6ez1V
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KdGluLWRldiBt
YWlsaW5nIGxpc3QKdGluLWRldkB0aW4ub3JnCmh0dHA6Ly9saXN0cy50aW4ub3JnL2NnaS1iaW4v
bWFpbG1hbi9saXN0aW5mby90aW4tZGV2Cg==
--xHFwDpU9dbj6ez1V--