Commit 36536670 authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

typo fixes

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4129 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 8 additions and 5 deletions
+8 -5
2007-07-09 David Lawrence Ramsey <pooka109@gmail.com> 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, * chars.c (mbstrncasecmp, mbstrnlen, mbstrpbrk,
has_blank_mbchars): Simplify by using for loops instead of while has_blank_mbchars): Simplify by using for loops instead of while
loops where possible, to match the single-byte versions of these loops where possible, to match the single-byte versions of these
......
...@@ -603,7 +603,7 @@ char *nstrcasestr(const char *haystack, const char *needle) ...@@ -603,7 +603,7 @@ char *nstrcasestr(const char *haystack, const char *needle)
{ {
assert(haystack != NULL && needle != NULL); assert(haystack != NULL && needle != NULL);
if (needle == '\0') if (*needle == '\0')
return (char *)haystack; return (char *)haystack;
for (; *haystack != '\0'; haystack++) { for (; *haystack != '\0'; haystack++) {
...@@ -631,7 +631,7 @@ char *mbstrcasestr(const char *haystack, const char *needle) ...@@ -631,7 +631,7 @@ char *mbstrcasestr(const char *haystack, const char *needle)
assert(haystack != NULL && needle != NULL); assert(haystack != NULL && needle != NULL);
if (needle == '\0') if (*needle == '\0')
return (char *)haystack; return (char *)haystack;
r_mb = charalloc(MB_CUR_MAX); r_mb = charalloc(MB_CUR_MAX);
...@@ -693,7 +693,7 @@ char *revstrstr(const char *haystack, const char *needle, const char ...@@ -693,7 +693,7 @@ char *revstrstr(const char *haystack, const char *needle, const char
{ {
assert(haystack != NULL && needle != NULL && rev_start != NULL); assert(haystack != NULL && needle != NULL && rev_start != NULL);
if (needle == '\0') if (*needle == '\0')
return (char *)rev_start; return (char *)rev_start;
for (; rev_start >= haystack; rev_start--) { for (; rev_start >= haystack; rev_start--) {
...@@ -718,7 +718,7 @@ char *revstrcasestr(const char *haystack, const char *needle, const char ...@@ -718,7 +718,7 @@ char *revstrcasestr(const char *haystack, const char *needle, const char
{ {
assert(haystack != NULL && needle != NULL && rev_start != NULL); assert(haystack != NULL && needle != NULL && rev_start != NULL);
if (needle == '\0') if (*needle == '\0')
return (char *)rev_start; return (char *)rev_start;
for (; rev_start >= haystack; rev_start--) { for (; rev_start >= haystack; rev_start--) {
...@@ -748,7 +748,7 @@ char *mbrevstrcasestr(const char *haystack, const char *needle, const ...@@ -748,7 +748,7 @@ char *mbrevstrcasestr(const char *haystack, const char *needle, const
assert(haystack != NULL && needle != NULL && rev_start != NULL); assert(haystack != NULL && needle != NULL && rev_start != NULL);
if (needle == '\0') if (*needle == '\0')
return (char *)rev_start; return (char *)rev_start;
r_mb = charalloc(MB_CUR_MAX); r_mb = charalloc(MB_CUR_MAX);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment