typo fixes

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4129 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
David Lawrence Ramsey 2007-07-09 22:57:07 +00:00
parent bebfd9fbb6
commit 36536670c8
2 changed files with 8 additions and 5 deletions

View File

@ -1,5 +1,8 @@
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

View File

@ -603,7 +603,7 @@ char *nstrcasestr(const char *haystack, const char *needle)
{
assert(haystack != NULL && needle != NULL);
if (needle == '\0')
if (*needle == '\0')
return (char *)haystack;
for (; *haystack != '\0'; haystack++) {
@ -631,7 +631,7 @@ char *mbstrcasestr(const char *haystack, const char *needle)
assert(haystack != NULL && needle != NULL);
if (needle == '\0')
if (*needle == '\0')
return (char *)haystack;
r_mb = charalloc(MB_CUR_MAX);
@ -693,7 +693,7 @@ char *revstrstr(const char *haystack, const char *needle, const char
{
assert(haystack != NULL && needle != NULL && rev_start != NULL);
if (needle == '\0')
if (*needle == '\0')
return (char *)rev_start;
for (; rev_start >= haystack; rev_start--) {
@ -718,7 +718,7 @@ char *revstrcasestr(const char *haystack, const char *needle, const char
{
assert(haystack != NULL && needle != NULL && rev_start != NULL);
if (needle == '\0')
if (*needle == '\0')
return (char *)rev_start;
for (; rev_start >= haystack; rev_start--) {
@ -748,7 +748,7 @@ char *mbrevstrcasestr(const char *haystack, const char *needle, const
assert(haystack != NULL && needle != NULL && rev_start != NULL);
if (needle == '\0')
if (*needle == '\0')
return (char *)rev_start;
r_mb = charalloc(MB_CUR_MAX);