projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
faccessat: port to Solaris 10
[gnulib.git]
/
lib
/
mbscasestr.c
diff --git
a/lib/mbscasestr.c
b/lib/mbscasestr.c
index
379b2fb
..
c47dcc8
100644
(file)
--- a/
lib/mbscasestr.c
+++ b/
lib/mbscasestr.c
@@
-1,5
+1,5
@@
/* Case-insensitive searching in a string.
/* Case-insensitive searching in a string.
- Copyright (C) 2005-201
1
Free Software Foundation, Inc.
+ Copyright (C) 2005-201
2
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
@@
-30,6
+30,7
@@
#define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch))
/* Knuth-Morris-Pratt algorithm. */
#define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch))
/* Knuth-Morris-Pratt algorithm. */
+#define UNIT unsigned char
#define CANON_ELEMENT(c) TOLOWER (c)
#include "str-kmp.h"
#define CANON_ELEMENT(c) TOLOWER (c)
#include "str-kmp.h"
@@
-368,10
+369,12
@@
mbscasestr (const char *haystack, const char *needle)
if (needle_last_ccount == NULL)
{
/* Try the Knuth-Morris-Pratt algorithm. */
if (needle_last_ccount == NULL)
{
/* Try the Knuth-Morris-Pratt algorithm. */
- const char *result;
+ const
unsigned
char *result;
bool success =
bool success =
- knuth_morris_pratt_unibyte (haystack, needle - 1,
- &result);
+ knuth_morris_pratt ((const unsigned char *) haystack,
+ (const unsigned char *) (needle - 1),
+ strlen (needle - 1),
+ &result);
if (success)
return (char *) result;
try_kmp = false;
if (success)
return (char *) result;
try_kmp = false;