break;
}
- haystack += parse_mbchar(haystack, NULL, NULL, NULL);
+ haystack += move_mbright(haystack, 0);
}
free(r_mb);
#ifndef NANO_SMALL
/* This function is equivalent to strstr(), except in that it scans the
- * string in reverse. */
+ * string in reverse, starting at rev_start. */
const char *revstrstr(const char *haystack, const char *needle, const
char *rev_start)
{
for (; rev_start >= haystack; rev_start--) {
const char *r, *q;
- for (r = rev_start, q = needle; *q == *r && *q != '\0'; r++, q++)
+ for (r = rev_start, q = needle; *r == *q && *q != '\0'; r++, q++)
;
if (*q == '\0')
}
/* This function is equivalent to strcasestr(), except in that it scans
- * the string in reverse. */
+ * the string in reverse, starting at rev_start. */
const char *revstrcasestr(const char *haystack, const char *needle,
const char *rev_start)
{
for (; rev_start >= haystack; rev_start--) {
const char *r = rev_start, *q = needle;
- for (; tolower(*q) == tolower(*r) && *q != '\0'; r++, q++)
+ for (; tolower(*r) == tolower(*q) && *q != '\0'; r++, q++)
;
if (*q == '\0')
#ifndef NANO_SMALL
const char *revstrstr(const char *haystack, const char *needle, const
char *rev_start);
-const char *revstrcasestr(const char *haystack, const char *needle, const
- char *rev_start);
+const char *revstrcasestr(const char *haystack, const char *needle,
+ const char *rev_start);
#endif
#ifndef HAVE_STRNLEN
size_t nstrnlen(const char *s, size_t maxlen);
} else
#endif /* !NANO_SMALL */
if (regexec(&search_regexp, start, 10, regmatches,
- start > haystack ? REG_NOTBOL : 0) == 0) {
+ (start > haystack) ? REG_NOTBOL : 0) == 0) {
const char *retval = start + regmatches[0].rm_so;
regexec(&search_regexp, retval, 10, regmatches, 0);