From: David Lawrence Ramsey Date: Sat, 22 Jan 2005 20:49:14 +0000 (+0000) Subject: cosmetic and formatting fixes X-Git-Tag: v1.3.6~108 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=3ee4cf30278fab9b131ec16c119223d074561cbf;p=nano.git cosmetic and formatting fixes git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2295 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/src/chars.c b/src/chars.c index 128a0497..ccd0d7e3 100644 --- a/src/chars.c +++ b/src/chars.c @@ -635,7 +635,7 @@ const char *mbstrcasestr(const char *haystack, const char *needle) break; } - haystack += parse_mbchar(haystack, NULL, NULL, NULL); + haystack += move_mbright(haystack, 0); } free(r_mb); @@ -654,7 +654,7 @@ const char *mbstrcasestr(const char *haystack, const char *needle) #ifndef NANO_SMALL /* This function is equivalent to strstr(), except in that it scans the - * string in reverse. */ + * string in reverse, starting at rev_start. */ const char *revstrstr(const char *haystack, const char *needle, const char *rev_start) { @@ -663,7 +663,7 @@ const char *revstrstr(const char *haystack, const char *needle, const for (; rev_start >= haystack; rev_start--) { const char *r, *q; - for (r = rev_start, q = needle; *q == *r && *q != '\0'; r++, q++) + for (r = rev_start, q = needle; *r == *q && *q != '\0'; r++, q++) ; if (*q == '\0') @@ -674,7 +674,7 @@ const char *revstrstr(const char *haystack, const char *needle, const } /* This function is equivalent to strcasestr(), except in that it scans - * the string in reverse. */ + * the string in reverse, starting at rev_start. */ const char *revstrcasestr(const char *haystack, const char *needle, const char *rev_start) { @@ -683,7 +683,7 @@ const char *revstrcasestr(const char *haystack, const char *needle, for (; rev_start >= haystack; rev_start--) { const char *r = rev_start, *q = needle; - for (; tolower(*q) == tolower(*r) && *q != '\0'; r++, q++) + for (; tolower(*r) == tolower(*q) && *q != '\0'; r++, q++) ; if (*q == '\0') diff --git a/src/proto.h b/src/proto.h index dd078580..3d1e7649 100644 --- a/src/proto.h +++ b/src/proto.h @@ -197,8 +197,8 @@ const char *mbstrcasestr(const char *haystack, const char *needle); #ifndef NANO_SMALL const char *revstrstr(const char *haystack, const char *needle, const char *rev_start); -const char *revstrcasestr(const char *haystack, const char *needle, const - char *rev_start); +const char *revstrcasestr(const char *haystack, const char *needle, + const char *rev_start); #endif #ifndef HAVE_STRNLEN size_t nstrnlen(const char *s, size_t maxlen); diff --git a/src/utils.c b/src/utils.c index cbd67820..601ee296 100644 --- a/src/utils.c +++ b/src/utils.c @@ -222,7 +222,7 @@ const char *strstrwrapper(const char *haystack, const char *needle, } else #endif /* !NANO_SMALL */ if (regexec(&search_regexp, start, 10, regmatches, - start > haystack ? REG_NOTBOL : 0) == 0) { + (start > haystack) ? REG_NOTBOL : 0) == 0) { const char *retval = start + regmatches[0].rm_so; regexec(&search_regexp, retval, 10, regmatches, 0);