summaryrefslogtreecommitdiff
path: root/modules/string
diff options
context:
space:
mode:
authorEric Blake <ebb9@byu.net>2008-01-10 07:38:11 -0700
committerEric Blake <ebb9@byu.net>2008-01-10 14:31:04 -0700
commit96facb24aa17b8d412d2f37fa91d59282d950ebb (patch)
treebbf196a18ac8c1b0c27df73862ce5b3d39a8dab0 /modules/string
parent619c189e199adf139ed298d1852e92987eb6289f (diff)
downloadgnulib-96facb24aa17b8d412d2f37fa91d59282d950ebb.tar.gz
Avoid quadratic strstr implementations.
* lib/strstr.c: New file. * m4/strstr.m4: Likewise. * modules/strstr: Likewise. * modules/strstr-tests: Likewise. * tests/test-strstr.c: Likewise. * lib/string.in.h (rpl_strstr): Declare. (memmem) [GNULIB_POSIXCHECK]: Document speed issue. * m4/string_h.m4 (gl_HEADER_STRING_H_DEFAULTS): Support strstr. * modules/string (Makefile.am): Likewise. * MODULES.html.sh (string handling): Mention new module. * doc/functions/strstr.texi (strstr): Document the bug. Signed-off-by: Eric Blake <ebb9@byu.net>
Diffstat (limited to 'modules/string')
-rw-r--r--modules/string2
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/string b/modules/string
index 6f3226d0fe..431a32236c 100644
--- a/modules/string
+++ b/modules/string
@@ -48,6 +48,7 @@ string.h: string.in.h
-e 's|@''GNULIB_STRNLEN''@|$(GNULIB_STRNLEN)|g' \
-e 's|@''GNULIB_STRPBRK''@|$(GNULIB_STRPBRK)|g' \
-e 's|@''GNULIB_STRSEP''@|$(GNULIB_STRSEP)|g' \
+ -e 's|@''GNULIB_STRSTR''@|$(GNULIB_STRSTR)|g' \
-e 's|@''GNULIB_STRCASESTR''@|$(GNULIB_STRCASESTR)|g' \
-e 's|@''GNULIB_STRTOK_R''@|$(GNULIB_STRTOK_R)|g' \
-e 's|@''GNULIB_STRERROR''@|$(GNULIB_STRERROR)|g' \
@@ -67,6 +68,7 @@ string.h: string.in.h
-e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \
-e 's|@''HAVE_DECL_STRERROR''@|$(HAVE_DECL_STRERROR)|g' \
-e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \
+ -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \
-e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/string.in.h; \