nstrncasecmp(), mbstrncasecmp()
- For efficiency, return zero immediately if s1 and s2 point to
the same string. (DLR)
+ nstrcasestr(), mbstrcasestr(), revstrstr(), revstrcasestr(),
+ mbrevstrcasestr()
+ - For efficiency, return haystack immediately if
+ needle/rev_start is blank. (DLR)
- prompt.c:
do_yesno_prompt()
- Remove redundant check for NO_HELP's being FALSE. (DLR)
{
assert(haystack != NULL && needle != NULL);
+ if (needle == '\0')
+ return haystack;
+
for (; *haystack != '\0'; haystack++) {
const char *r = haystack, *q = needle;
assert(haystack != NULL && needle != NULL);
+ if (needle == '\0')
+ return haystack;
+
r_mb = charalloc(MB_CUR_MAX);
q_mb = charalloc(MB_CUR_MAX);
{
assert(haystack != NULL && needle != NULL && rev_start != NULL);
+ if (needle == '\0')
+ return rev_start;
+
for (; rev_start >= haystack; rev_start--) {
const char *r, *q;
{
assert(haystack != NULL && needle != NULL && rev_start != NULL);
+ if (needle == '\0')
+ return rev_start;
+
for (; rev_start >= haystack; rev_start--) {
const char *r = rev_start, *q = needle;
assert(haystack != NULL && needle != NULL && rev_start != NULL);
+ if (needle == '\0')
+ return rev_start;
+
r_mb = charalloc(MB_CUR_MAX);
q_mb = charalloc(MB_CUR_MAX);