updated for version 7.3.877
Problem: Forward searching with search() is broken.
Solution: Fix it and add tests. (Sung Pae)
diff --git a/src/search.c b/src/search.c
index 934e4b0..f9a5b84 100644
--- a/src/search.c
+++ b/src/search.c
@@ -727,7 +727,7 @@
++matchcol;
}
}
- if (options & SEARCH_START)
+ if (matchcol == 0 && (options & SEARCH_START))
break;
if (ptr[matchcol] == NUL
|| (nmatched = vim_regexec_multi(®match,
@@ -869,7 +869,7 @@
/* With the SEARCH_END option move to the last character
* of the match. Don't do it for an empty match, end
* should be same as start then. */
- if (options & SEARCH_END && !(options & SEARCH_NOOF)
+ if ((options & SEARCH_END) && !(options & SEARCH_NOOF)
&& !(matchpos.lnum == endpos.lnum
&& matchpos.col == endpos.col))
{