/* Case-insensitive searching in a string.
- Copyright (C) 2005-2008 Free Software Foundation, Inc.
+ Copyright (C) 2005-2010 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2005.
This program is free software; you can redistribute it and/or modify
/* Two-Way algorithm. */
#define RETURN_TYPE char *
-#define AVAILABLE(h, h_l, j, n_l) \
- (!memchr ((h) + (h_l), '\0', (j) + (n_l) - (h_l)) \
+#define AVAILABLE(h, h_l, j, n_l) \
+ (!memchr ((h) + (h_l), '\0', (j) + (n_l) - (h_l)) \
&& ((h_l) = (j) + (n_l)))
#define CANON_ELEMENT(c) TOLOWER (c)
-#define CMP_FUNC(p1, p2, l) \
+#define CMP_FUNC(p1, p2, l) \
strncasecmp ((const char *) (p1), (const char *) (p2), l)
#include "str-two-way.h"
while (*haystack && *needle)
{
ok &= (TOLOWER ((unsigned char) *haystack)
- == TOLOWER ((unsigned char) *needle));
+ == TOLOWER ((unsigned char) *needle));
haystack++;
needle++;
}
ISO C 99 section 6.2.6.1. */
if (needle_len < LONG_NEEDLE_THRESHOLD)
return two_way_short_needle ((const unsigned char *) haystack,
- haystack_len,
- (const unsigned char *) needle_start,
- needle_len);
+ haystack_len,
+ (const unsigned char *) needle_start,
+ needle_len);
return two_way_long_needle ((const unsigned char *) haystack, haystack_len,
- (const unsigned char *) needle_start,
- needle_len);
+ (const unsigned char *) needle_start,
+ needle_len);
}
#undef LONG_NEEDLE_THRESHOLD