Document the knuth_morris_pratt calling convention better.
authorBruno Haible <bruno@clisp.org>
Tue, 8 Jan 2008 22:54:30 +0000 (23:54 +0100)
committerBruno Haible <bruno@clisp.org>
Tue, 8 Jan 2008 22:54:30 +0000 (23:54 +0100)
ChangeLog
lib/mbscasestr.c
lib/mbsstr.c
lib/str-kmp.h

index a04644c..e9e5c84 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 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
        detect bug on OpenBSD 4.0.
        * doc/functions/wcwidth.texi: Document the OpenBSD bug.
index 82eb968..a136b21 100644 (file)
@@ -1,5 +1,5 @@
 /* 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
@@ -38,7 +38,9 @@
 #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)
index 4883780..35fd02b 100644 (file)
@@ -1,5 +1,5 @@
 /* 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
@@ -35,7 +35,9 @@
 #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)
index c7882d1..cf16e4d 100644 (file)
@@ -1,6 +1,6 @@
 /* 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
@@ -25,7 +25,9 @@
 
 /* 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)