projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
md5, sha1, sha256, sha512: use openssl routines if available
[gnulib.git]
/
lib
/
strcasestr.c
diff --git
a/lib/strcasestr.c
b/lib/strcasestr.c
index
fe970ae
..
3cca84a
100644
(file)
--- a/
lib/strcasestr.c
+++ b/
lib/strcasestr.c
@@
-1,5
+1,5
@@
/* Case-insensitive searching in a string.
/* Case-insensitive searching in a string.
- Copyright (C) 2005-20
08
Free Software Foundation, Inc.
+ Copyright (C) 2005-20
13
Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2005.
This program is free software; you can redistribute it and/or modify
Written by Bruno Haible <bruno@clisp.org>, 2005.
This program is free software; you can redistribute it and/or modify
@@
-13,8
+13,7
@@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <config.h>
@@
-29,11
+28,11
@@
/* Two-Way algorithm. */
#define RETURN_TYPE char *
/* 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)
&& ((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"
strncasecmp ((const char *) (p1), (const char *) (p2), l)
#include "str-two-way.h"
@@
-55,7
+54,7
@@
strcasestr (const char *haystack_start, const char *needle_start)
while (*haystack && *needle)
{
ok &= (TOLOWER ((unsigned char) *haystack)
while (*haystack && *needle)
{
ok &= (TOLOWER ((unsigned char) *haystack)
- == TOLOWER ((unsigned char) *needle));
+
== TOLOWER ((unsigned char) *needle));
haystack++;
needle++;
}
haystack++;
needle++;
}
@@
-72,12
+71,12
@@
strcasestr (const char *haystack_start, const char *needle_start)
ISO C 99 section 6.2.6.1. */
if (needle_len < LONG_NEEDLE_THRESHOLD)
return two_way_short_needle ((const unsigned char *) haystack,
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,
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
}
#undef LONG_NEEDLE_THRESHOLD