+2008-01-08 Bruno Haible <bruno@clisp.org>
+
+ * lib/str-kmp.h (knuth_morris_pratt_unibyte): Document the calling
+ convention better.
+ * lib/mbsstr.c (knuth_morris_pratt_multibyte): Likewise.
+ * lib/mbscasestr.c (knuth_morris_pratt_multibyte): Likewise.
+ Reported by Peter Miller <millerp@canb.auug.org.au>.
+
2008-01-08 Bruno Haible <bruno@clisp.org>
* m4/wcwidth.m4 (gl_FUNC_WCWIDTH): Test also U+3000. Needed to
/* Case-insensitive searching in a string.
- Copyright (C) 2005-2007 Free Software Foundation, Inc.
+ Copyright (C) 2005-2008 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2005.
This program is free software: you can redistribute it and/or modify
#if HAVE_MBRTOWC
/* Knuth-Morris-Pratt algorithm.
See http://en.wikipedia.org/wiki/Knuth-Morris-Pratt_algorithm
- Return a boolean indicating success. */
+ Return a boolean indicating success:
+ Return true and set *RESULTP if the search was completed.
+ Return false if it was aborted because not enough memory was available. */
static bool
knuth_morris_pratt_multibyte (const char *haystack, const char *needle,
const char **resultp)
/* Searching in a string.
- Copyright (C) 2005-2007 Free Software Foundation, Inc.
+ Copyright (C) 2005-2008 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2005.
This program is free software: you can redistribute it and/or modify
#if HAVE_MBRTOWC
/* Knuth-Morris-Pratt algorithm.
See http://en.wikipedia.org/wiki/Knuth-Morris-Pratt_algorithm
- Return a boolean indicating success. */
+ Return a boolean indicating success:
+ Return true and set *RESULTP if the search was completed.
+ Return false if it was aborted because not enough memory was available. */
static bool
knuth_morris_pratt_multibyte (const char *haystack, const char *needle,
const char **resultp)
/* Substring search in a NUL terminated string of 'char' elements,
using the Knuth-Morris-Pratt algorithm.
- Copyright (C) 2005-2007 Free Software Foundation, Inc.
+ Copyright (C) 2005-2008 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2005.
This program is free software; you can redistribute it and/or modify
/* Knuth-Morris-Pratt algorithm.
See http://en.wikipedia.org/wiki/Knuth-Morris-Pratt_algorithm
- Return a boolean indicating success. */
+ Return a boolean indicating success:
+ Return true and set *RESULTP if the search was completed.
+ Return false if it was aborted because not enough memory was available. */
static bool
knuth_morris_pratt_unibyte (const char *haystack, const char *needle,
const char **resultp)