* lib/memmem.c (knuth_morris_pratt): Check for size_t overflow
[gnulib.git] / ChangeLog
index d52195d..ada100e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,162 @@
+2007-12-29  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * lib/memmem.c (knuth_morris_pratt): Check for size_t overflow
+       when multiplying M by sizeof (size_t).
+
+2007-12-10  Martin Lambers <marlam@marlam.de>
+
+       Override getpagesize on mingw.
+       * lib/getpagesize.c: New file.
+       * m4/getpagesize.m4 (gl_FUNC_GETPAGESIZE): Enable replacement on mingw.
+       * modules/getpagesize (Files): Add lib/getpagesize.c.
+       * lib/unistd.in.h (getpagesize): Declare if we are using a replacement.
+       * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize
+       REPLACE_GETPAGESIZE.
+       * modules/unistd (Makefile.am): Substitute REPLACE_GETPAGESIZE.
+
+2007-12-25  Bruno Haible  <bruno@clisp.org>
+
+       * modules/localcharset (Notice): New field.
+       (configure.ac): Define LOCALCHARSET_TESTS_ENVIRONMENT.
+       Suggested by Ben Pfaff <blp@cs.stanford.edu>.
+
+2007-12-25  Paul Eggert  <eggert@cs.ucla.edu>
+            Bruno Haible  <bruno@clisp.org>
+
+       Avoid using the syntax symbol() in formatted documentation.
+       * MODULES.html.sh (func_module): When replacing symbol() with a
+       hyperlink, remove the parentheses. Show an error if some remain.
+       Recognize and render the '...' syntax.
+       * doc/alloca-opt.texi: Remove parentheses from symbol reference.
+       Rework. Add paragraph about GCC's inlining.
+       * doc/alloca.texi: Likewise.
+       * doc/error.texi: Remove parentheses from symbol reference.
+       * doc/gnulib-intro.texi: Likewise.
+       * doc/gnulib.texi (alloca, alloca-opt): New nodes.
+       * modules/fnmatch (Description): Reword to say "the ... function".
+       * modules/full-read (Description): Likewise.
+       * modules/full-write (Description): Likewise.
+       * modules/safe-read (Description): Likewise.
+       * modules/safe-write (Description): Likewise.
+       * modules/strchrnul (Description): Likewise.
+       * modules/trim (Description): Likewise.
+       * modules/error (Description): Remove parentheses from symbol
+       references.
+       * modules/verror (Description): Likewise.
+       Reported by Karl Berry.
+
+2007-12-25  Bruno Haible  <bruno@clisp.org>
+
+       Fixup after 2007-10-16 commit.
+       * lib/glob.c (glob_in_dir): Don't use ISO C99 syntax.
+
+2007-12-24  Bruno Haible  <bruno@clisp.org>
+
+       Make --enable-relocatable work with DESTDIR.
+       * build-aux/install-reloc: Accept another argument 'destdir'. Use it
+       to compute installdir from destprog.
+       * m4/relocatable.m4 (gl_RELOCATABLE_BODY): In INSTALL_PROGRAM_ENV,
+       also set the RELOC_DESTDIR variable.
+       Reported by Левашев Иван <octagram@bluebottle.com>.
+
+2007-12-24  Bruno Haible  <bruno@clisp.org>
+
+       Fix link error due to xalloc_die().
+       * lib/progreloc.c: When NO_XMALLOC is defined, use areadlink instead
+       of xreadlink.
+       * lib/relocwrapper.c: Update comments.
+       * build-aux/install-reloc: Remove xreadlink.c from file list.
+       * modules/relocatable-prog-wrapper (Files): Remove xreadlink.h and
+       xreadlink.c.
+       Reported by Левашев Иван <octagram@bluebottle.com>.
+
+2007-12-24  Bruno Haible  <bruno@clisp.org>
+
+       Split setenv module into setenv and unsetenv. Get rid of setenv.h.
+       * lib/setenv.h: Remove file.
+       * lib/stdlib.in.h (setenv, unsetenv): New declarations, moved here from
+       lib/setenv.h.
+       * modules/setenv (Files): Remove lib/setenv.h, lib/unsetenv.c.
+       (Depends-on): Add stdlib.
+       (configure.ac): Invoke gl_STDLIB_MODULE_INDICATOR. Don't invoke
+       gl_FUNC_UNSETENV.
+       (Include): Replace setenv.h with <stdlib.h>.
+       * modules/unsetenv: New file.
+       * lib/setenv.c: Include <stdlib.h> first, after alloca.h.
+       * lib/unsetenv.c: Include <stdlib.h> first.
+       * m4/setenv.m4 (gl_FUNC_SETENV, gl_FUNC_SETENV_SEPARATE): Require
+       gl_STDLIB_H_DEFAULTS. Conditionally set HAVE_SETENV to 0.
+       (gl_FUNC_UNSETENV): Require gl_STDLIB_H_DEFAULTS. Conditionally set
+       HAVE_UNSETENV to 0. Set VOID_UNSETENV as an AC_SUBSTed variable.
+       * modules/stdlib (Makefile.am): Substitute also GNULIB_SETENV,
+       HAVE_SETENV, GNULIB_UNSETENV, HAVE_UNSETENV, VOID_UNSETENV.
+       * m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Initialize GNULIB_SETENV,
+       HAVE_SETENV, GNULIB_UNSETENV, HAVE_UNSETENV, VOID_UNSETENV.
+       * doc/functions/unsetenv.texi: Update.
+       * modules/xsetenv (Depends-on): Add unsetenv.
+       * modules/getdate (Depends-on): Likewise.
+       * lib/xsetenv.h: Include <stdlib.h> instead of setenv.h.
+       * lib/xsetenv.c: Don't include setenv.h.
+       * lib/getdate.y: Likewise.
+       * lib/relocwrapper.c: Likewise.
+       * modules/relocatable-prog-wrapper (Files): Remove lib/setenv.h.
+       (Depends-on): Add stdlib.
+       * NEWS: Mention the changes.
+       Reported by Левашев Иван <octagram@bluebottle.com>.
+
+2007-12-23  Bruno Haible  <bruno@clisp.org>
+
+       * lib/memmem.c (memmem): Use lowercase variable names. Tab
+       indentation.
+
+2007-12-23  Bruno Haible  <bruno@clisp.org>
+
+       * lib/c-strcasestr.c: Add more comments.
+       * lib/c-strstr.c: Likewise.
+       * lib/mbscasestr.c: Likewise.
+       * lib/mbsstr.c: Likewise.
+       * lib/strcasestr.c: Likewise.
+       * lib/memmem.c: Likewise.
+
+2007-12-23  Bruno Haible  <bruno@clisp.org>
+
+       * tests/test-memmem.c: Include <string.h> first.
+
+2007-12-22  Bruno Haible  <bruno@clisp.org>
+
+       * gnulib-tool (func_create_testdir): Change $auxdir while generating
+       the contents of $testsbase.
+       Reported by Ralf Wildenhues.
+
+2007-12-22  Bruno Haible  <bruno@clisp.org>
+
+       * gnulib-tool (func_emit_tests_Makefile_am): Replace local_ldadd with
+       two variables local_ldadd_before, local_ldadd_last.
+
+2007-12-20  Eric Blake  <ebb9@byu.net>
+
+       Work around circular library issue when cross-compiling.
+       * lib/progname.c (set_program_name): Use strncmp, not memcmp, so
+       that progname.o does not need to pull in rpl_memcmp.
+
+2007-12-19  Eric Blake  <ebb9@byu.net>
+
+       Fix memmem to avoid O(n^2) worst-case complexity.
+       * lib/memmem.c (knuth_morris_pratt): New function.
+       (memmem): Use it if first few naive iterations fail.
+       * m4/memmem.m4 (gl_FUNC_MEMMEM): Detect cygwin bug.
+       * modules/memcmp (License): Set to LGPLv2+, not LGPL.
+       * modules/memchr (License): Likewise.
+       * modules/memmem (Depends-on): Add memcmp, memchr, stdbool, and
+       malloca.
+       * tests/test-memmem.c: Rewrite, borrowing ideas from
+       test-mbsstr1.c; the old version wouldn't even compile!
+       * modules/memmem-tests: New file.
+       * lib/string.in.h (rpl_memmem): Add declaration.
+       * modules/string (Makefile.am): Substitute REPLACE_MEMMEM.
+       * m4/string_h.m4 (gl_HEADER_STRING_H_DEFAULTS): Default for
+       REPLACE_MEMMEM.
+
 2007-12-18  Paul Eggert  <eggert@cs.ucla.edu>
 
        Fix problem with _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H on VMS.