From: Bruno Haible Date: Tue, 8 Jan 2008 22:54:30 +0000 (+0100) Subject: Document the knuth_morris_pratt calling convention better. X-Git-Tag: v0.1~7867 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=5c26c7d4ad5c61653975b68a38a59e2bec103e39;p=gnulib.git Document the knuth_morris_pratt calling convention better. --- diff --git a/ChangeLog b/ChangeLog index a04644c40..e9e5c84f6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2008-01-08 Bruno Haible + * 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 . + +2008-01-08 Bruno Haible + * 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. diff --git a/lib/mbscasestr.c b/lib/mbscasestr.c index 82eb968ae..a136b21d8 100644 --- a/lib/mbscasestr.c +++ b/lib/mbscasestr.c @@ -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 , 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) diff --git a/lib/mbsstr.c b/lib/mbsstr.c index 48837805b..35fd02b54 100644 --- a/lib/mbsstr.c +++ b/lib/mbsstr.c @@ -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 , 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) diff --git a/lib/str-kmp.h b/lib/str-kmp.h index c7882d13d..cf16e4d41 100644 --- a/lib/str-kmp.h +++ b/lib/str-kmp.h @@ -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 , 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)