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 a04644c4062e0c1937dbc83a41a9e120abf9ce4f..e9e5c84f6081522d1533a525983eed1995627f40 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+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
index 82eb968aea25b56e75050339576990ae5393f761..a136b21d8ca6d26ef577dd92b34fd58376e0bead 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 48837805b83b98a78d0eb7336995a42452ea9ce7..35fd02b544f4f1aae6e59a691e46372974d9f4a9 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 c7882d13d693b7faaf83b1a5afa0d7c82f491a27..cf16e4d41c28400b989286eda3ba2ce56e5ebd1b 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)