* doc/man/{nano.1,nanorc.5}, doc/texinfo/nano.texi: Add deprecation
notices for the options 'set const', 'set poslog' and '--poslog'.
Suggested by Eitan Adler.
+ * src/chars.c (mbstrcasestr, mbrevstrcasestr): When searching, find
+ only valid UTF-8 byte sequences. This fixes Savannah bug #45579.
2015-07-22 Mike Frysinger <vapier@gentoo.org>
* src/files.c (check_dotnano), src/global.c (thanks_for_all_the_fish),
for (; *haystack != '\0' && haystack_len >= needle_len;
haystack += move_mbright(haystack, 0), haystack_len--) {
- if (mbstrncasecmp(haystack, needle, needle_len) == 0)
+ if (mbstrncasecmp(haystack, needle, needle_len) == 0 &&
+ mblen(haystack, MB_CUR_MAX) > 0)
return (char *)haystack;
}
rev_start_len = mbstrlen(rev_start);
while (!begin_line) {
- if (rev_start_len >= needle_len && mbstrncasecmp(rev_start,
- needle, needle_len) == 0)
+ if (rev_start_len >= needle_len &&
+ mbstrncasecmp(rev_start, needle, needle_len) == 0 &&
+ mblen(rev_start, MB_CUR_MAX) > 0)
return (char *)rev_start;
if (rev_start == haystack)