2007-07-09 David Lawrence Ramsey <pooka109@gmail.com>
+ * chars.c (nstrcasestr, mbstrcasestr, revstrstr, revstrcasestr,
+ mbrevstrcasestr): Fix typo that broke the check for needle's
+ being blank.
* chars.c (mbstrncasecmp, mbstrnlen, mbstrpbrk,
has_blank_mbchars): Simplify by using for loops instead of while
loops where possible, to match the single-byte versions of these
{
assert(haystack != NULL && needle != NULL);
- if (needle == '\0')
+ if (*needle == '\0')
return (char *)haystack;
for (; *haystack != '\0'; haystack++) {
assert(haystack != NULL && needle != NULL);
- if (needle == '\0')
+ if (*needle == '\0')
return (char *)haystack;
r_mb = charalloc(MB_CUR_MAX);
{
assert(haystack != NULL && needle != NULL && rev_start != NULL);
- if (needle == '\0')
+ if (*needle == '\0')
return (char *)rev_start;
for (; rev_start >= haystack; rev_start--) {
{
assert(haystack != NULL && needle != NULL && rev_start != NULL);
- if (needle == '\0')
+ if (*needle == '\0')
return (char *)rev_start;
for (; rev_start >= haystack; rev_start--) {
assert(haystack != NULL && needle != NULL && rev_start != NULL);
- if (needle == '\0')
+ if (*needle == '\0')
return (char *)rev_start;
r_mb = charalloc(MB_CUR_MAX);