From 36536670c8c52c9cc9ab994c233979f97a5d523b Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Mon, 9 Jul 2007 22:57:07 +0000 Subject: [PATCH] typo fixes git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4129 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 3 +++ src/chars.c | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index dbc7adee..04a76926 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2007-07-09 David Lawrence Ramsey + * 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 diff --git a/src/chars.c b/src/chars.c index 4f393a31..043522aa 100644 --- a/src/chars.c +++ b/src/chars.c @@ -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); -- 2.39.5