[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[SCM] GNU gsasl branch, master, updated. gsasl-1-4-1-108-gd133ad1
From: |
Simon Josefsson |
Subject: |
[SCM] GNU gsasl branch, master, updated. gsasl-1-4-1-108-gd133ad1 |
Date: |
Tue, 30 Mar 2010 21:41:01 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU gsasl".
http://git.savannah.gnu.org/cgit/gsasl.git/commit/?id=d133ad1d12b756589c506b915dcf5db99c4a5ab0
The branch, master has been updated
via d133ad1d12b756589c506b915dcf5db99c4a5ab0 (commit)
via b76ec6b36d040c99f8d926cc6f494f67518b2924 (commit)
via 8ba906a345889eb984ead8176a3a4f19962f9d96 (commit)
from 1f68730a92b888b3ac9d33a1aef66bd075cb0c7b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit d133ad1d12b756589c506b915dcf5db99c4a5ab0
Author: Simon Josefsson <address@hidden>
Date: Tue Mar 30 23:40:24 2010 +0200
Add.
commit b76ec6b36d040c99f8d926cc6f494f67518b2924
Author: Simon Josefsson <address@hidden>
Date: Tue Mar 30 23:10:07 2010 +0200
Add strtok_r module, for MinGW and readnz.
commit 8ba906a345889eb984ead8176a3a4f19962f9d96
Author: Simon Josefsson <address@hidden>
Date: Tue Mar 30 22:59:21 2010 +0200
Update gnulib files. Add strnlen.
-----------------------------------------------------------------------
Summary of changes:
NEWS | 11 ++++++
gl/Makefile.am | 11 +++++-
gl/m4/gnulib-cache.m4 | 3 +-
gl/m4/gnulib-common.m4 | 19 +++++++---
gl/m4/gnulib-comp.m4 | 6 +++
gl/m4/strtok_r.m4 | 73 ++++++++++++++++++++++++++++++++++++++
gl/strtok_r.c | 76 ++++++++++++++++++++++++++++++++++++++++
lib/gl/Makefile.am | 11 +++++-
lib/gl/m4/gnulib-cache.m4 | 3 +-
lib/gl/m4/gnulib-common.m4 | 19 +++++++---
lib/gl/m4/gnulib-comp.m4 | 6 +++
lib/gl/m4/strnlen.m4 | 32 +++++++++++++++++
lib/gl/{memxor.c => strnlen.c} | 26 ++++++--------
lib/maint.mk | 43 +++++++++++-----------
maint.mk | 43 +++++++++++-----------
15 files changed, 309 insertions(+), 73 deletions(-)
create mode 100644 gl/m4/strtok_r.m4
create mode 100644 gl/strtok_r.c
create mode 100644 lib/gl/m4/strnlen.m4
copy lib/gl/{memxor.c => strnlen.c} (60%)
diff --git a/NEWS b/NEWS
index 9f842f0..955ad26 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,17 @@ SASL. That include the manual, the command line tool, and
self tests.
* Version 1.5.0 (unreleased) [beta]
+** doc: Explain GS2-related changes.
+
+** doc: GTK-DOC manual improved.
+Now almost all symbols and types are explained.
+
+** gsasl: Fix crash when getaddrinfo does not get a canonical name.
+
+** gsasl: Improve error message when server rejects authentication.
+
+** tests: Self checks are improved.
+
* Version 1.4.4 (released 2010-03-25) [stable]
** See lib/NEWS.
diff --git a/gl/Makefile.am b/gl/Makefile.am
index aa92543..41acdd6 100644
--- a/gl/Makefile.am
+++ b/gl/Makefile.am
@@ -9,7 +9,7 @@
# the same distribution terms as the rest of that program.
#
# Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl/override
--lib=libgl --source-base=gl --m4-base=gl/m4 --doc-base=doc
--tests-base=gltests --aux-dir=lib/build-aux --with-tests --libtool
--macro-prefix=gl --no-vc-files autobuild close connect error exit fdl-1.3
gendocs getaddrinfo getopt-gnu getpass gpl-3.0 lgpl-2.1 maintainer-makefile
manywarnings netdb netinet_in pmccabe2html poll progname quote readline recv
shutdown socket striconv sys_time unistd version-etc warnings xalloc
+# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl/override
--lib=libgl --source-base=gl --m4-base=gl/m4 --doc-base=doc
--tests-base=gltests --aux-dir=lib/build-aux --with-tests --libtool
--macro-prefix=gl --no-vc-files autobuild close connect error exit fdl-1.3
gendocs getaddrinfo getopt-gnu getpass gpl-3.0 lgpl-2.1 maintainer-makefile
manywarnings netdb netinet_in pmccabe2html poll progname quote readline recv
shutdown socket striconv strtok_r sys_time unistd version-etc warnings xalloc
AUTOMAKE_OPTIONS = 1.5 gnits
@@ -1218,6 +1218,15 @@ EXTRA_DIST += string.in.h
## end gnulib module string
+## begin gnulib module strtok_r
+
+
+EXTRA_DIST += strtok_r.c
+
+EXTRA_libgl_la_SOURCES += strtok_r.c
+
+## end gnulib module strtok_r
+
## begin gnulib module sys_select
BUILT_SOURCES += sys/select.h
diff --git a/gl/m4/gnulib-cache.m4 b/gl/m4/gnulib-cache.m4
index 9157ca3..a1ac47c 100644
--- a/gl/m4/gnulib-cache.m4
+++ b/gl/m4/gnulib-cache.m4
@@ -15,7 +15,7 @@
# Specification in the form of a command-line invocation:
-# gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgl
--source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gltests
--aux-dir=lib/build-aux --with-tests --libtool --macro-prefix=gl --no-vc-files
autobuild close connect error exit fdl-1.3 gendocs getaddrinfo getopt-gnu
getpass gpl-3.0 lgpl-2.1 maintainer-makefile manywarnings netdb netinet_in
pmccabe2html poll progname quote readline recv shutdown socket striconv
sys_time unistd version-etc warnings xalloc
+# gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgl
--source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gltests
--aux-dir=lib/build-aux --with-tests --libtool --macro-prefix=gl --no-vc-files
autobuild close connect error exit fdl-1.3 gendocs getaddrinfo getopt-gnu
getpass gpl-3.0 lgpl-2.1 maintainer-makefile manywarnings netdb netinet_in
pmccabe2html poll progname quote readline recv shutdown socket striconv
strtok_r sys_time unistd version-etc warnings xalloc
# Specification in the form of a few gnulib-tool.m4 macro invocations:
gl_LOCAL_DIR([gl/override])
@@ -45,6 +45,7 @@ gl_MODULES([
shutdown
socket
striconv
+ strtok_r
sys_time
unistd
version-etc
diff --git a/gl/m4/gnulib-common.m4 b/gl/m4/gnulib-common.m4
index f8e32e3..9cc519e 100644
--- a/gl/m4/gnulib-common.m4
+++ b/gl/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 17
+# gnulib-common.m4 serial 18
dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -48,7 +48,9 @@ AC_DEFUN([gl_MODULE_INDICATOR_CONDITION], [1])
# a C preprocessor expression that will evaluate to 1.
AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE],
[
-
GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=gl_MODULE_INDICATOR_CONDITION
+ GNULIB_[]m4_translit([[$1]],
+ [abcdefghijklmnopqrstuvwxyz./-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=gl_MODULE_INDICATOR_CONDITION
])
# gl_MODULE_INDICATOR([modulename])
@@ -65,9 +67,12 @@ AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE],
# --------------------------------------------+---------+-----------+
AC_DEFUN([gl_MODULE_INDICATOR],
[
-
AC_DEFINE_UNQUOTED([GNULIB_]translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___]),
+ AC_DEFINE_UNQUOTED([GNULIB_]m4_translit([[$1]],
+ [abcdefghijklmnopqrstuvwxyz./-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___]),
[gl_MODULE_INDICATOR_CONDITION],
- [Define to a C preprocessor expression that evaluates to 1 or 0, depending
whether the gnulib module ]$1[ shall be considered present.])
+ [Define to a C preprocessor expression that evaluates to 1 or 0,
+ depending whether the gnulib module $1 shall be considered present.])
])
# gl_MODULE_INDICATOR_FOR_TESTS([modulename])
@@ -85,8 +90,10 @@ AC_DEFUN([gl_MODULE_INDICATOR],
# --------------------------------------------+---------+-----------+
AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS],
[
-
AC_DEFINE([GNULIB_TEST_]translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___]),
[1],
- [Define to 1 when the gnulib module ]$1[ should be tested.])
+ AC_DEFINE([GNULIB_TEST_]m4_translit([[$1]],
+ [abcdefghijklmnopqrstuvwxyz./-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___]), [1],
+ [Define to 1 when the gnulib module $1 should be tested.])
])
# m4_foreach_w
diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4
index 28f898b..09217b5 100644
--- a/gl/m4/gnulib-comp.m4
+++ b/gl/m4/gnulib-comp.m4
@@ -181,6 +181,7 @@ AC_DEFUN([gl_EARLY],
# Code from module striconv-tests:
# Code from module string:
# Code from module string-tests:
+ # Code from module strtok_r:
# Code from module symlink:
# Code from module symlink-tests:
# Code from module sys_ioctl:
@@ -443,6 +444,9 @@ AC_SUBST([LTALLOCA])
fi
# Code from module string:
gl_HEADER_STRING_H
+ # Code from module strtok_r:
+ gl_FUNC_STRTOK_R
+ gl_STRING_MODULE_INDICATOR([strtok_r])
# Code from module sys_select:
gl_HEADER_SYS_SELECT
AC_PROG_MKDIR_P
@@ -823,6 +827,7 @@ AC_DEFUN([gl_FILE_LIST], [
lib/striconv.c
lib/striconv.h
lib/string.in.h
+ lib/strtok_r.c
lib/sys_select.in.h
lib/sys_socket.in.h
lib/sys_time.in.h
@@ -941,6 +946,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/strdup.m4
m4/strerror.m4
m4/string_h.m4
+ m4/strtok_r.m4
m4/symlink.m4
m4/sys_ioctl_h.m4
m4/sys_select_h.m4
diff --git a/gl/m4/strtok_r.m4 b/gl/m4/strtok_r.m4
new file mode 100644
index 0000000..f9847da
--- /dev/null
+++ b/gl/m4/strtok_r.m4
@@ -0,0 +1,73 @@
+# strtok_r.m4 serial 9
+dnl Copyright (C) 2002, 2003, 2004, 2007, 2009, 2010 Free Software Foundation,
+dnl Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_STRTOK_R],
+[
+ dnl The strtok_r() declaration in lib/string.in.h uses 'restrict'.
+ AC_REQUIRE([AC_C_RESTRICT])
+
+ AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CHECK_FUNCS([strtok_r])
+ if test $ac_cv_func_strtok_r = yes; then
+ dnl glibc 2.7 has a bug in strtok_r that causes a segmentation fault
+ dnl when the second argument to strtok_r is a constant string that has
+ dnl exactly one byte and compiling with optimization. Â This bug is, for
+ dnl example, present in the glibc 2.7-18 package in Debian "lenny".
+ dnl See <http://sources.redhat.com/bugzilla/show_bug.cgi?id=5614>.
+ AC_CACHE_CHECK([whether strtok_r works], [gl_cv_func_strtok_r_works],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #ifndef __OPTIMIZE__
+ # define __OPTIMIZE__ 1
+ #endif
+ #undef __OPTIMIZE_SIZE__
+ #undef __NO_INLINE__
+ #include <stdlib.h>
+ #include <string.h>
+ ]],
+ [[char delimiters[] = "xxxxxxxx";
+ Â Â Â Â Â Â char *save_ptr = (char *) 0xd0d0;
+ Â Â Â Â Â Â strtok_r (delimiters, "x", &save_ptr);
+ Â Â Â Â Â Â strtok_r (NULL, "x", &save_ptr);
+ Â Â Â Â Â Â return 0;
+ ]])
+ ],
+ [gl_cv_func_strtok_r_works=yes],
+ [gl_cv_func_strtok_r_works=no],
+ [
+changequote(,)dnl
+ case "$host_os" in
+ # Guess no on glibc systems.
+ *-gnu*) gl_cv_func_strtok_r_works="guessing no";;
+ *) gl_cv_func_strtok_r_works="guessing yes";;
+ esac
+changequote([,])dnl
+ ])
+ ])
+ case "$gl_cv_func_strtok_r_works" in
+ *no)
+ dnl We could set REPLACE_STRTOK_R=1 and AC_LIBOBJ([strtok_r]) here,
+ dnl but it's only the macro version in <bits/string2.h> which is wrong.
+ dnl The code compiled into libc is fine.
+ UNDEFINE_STRTOK_R=1
+ ;;
+ esac
+ else
+ AC_LIBOBJ([strtok_r])
+ fi
+ AC_CHECK_DECLS_ONCE([strtok_r])
+ if test $ac_cv_have_decl_strtok_r = no; then
+ HAVE_DECL_STRTOK_R=0
+ fi
+ gl_PREREQ_STRTOK_R
+])
+
+# Prerequisites of lib/strtok_r.c.
+AC_DEFUN([gl_PREREQ_STRTOK_R], [
+ :
+])
diff --git a/gl/strtok_r.c b/gl/strtok_r.c
new file mode 100644
index 0000000..2d636a5
--- /dev/null
+++ b/gl/strtok_r.c
@@ -0,0 +1,76 @@
+/* Reentrant string tokenizer. Generic version.
+ Copyright (C) 1991, 1996-1999, 2001, 2004, 2007, 2009-2010 Free Software
+ Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <string.h>
+
+#ifdef _LIBC
+# undef strtok_r
+# undef __strtok_r
+#else
+# define __strtok_r strtok_r
+# define __rawmemchr strchr
+#endif
+
+/* Parse S into tokens separated by characters in DELIM.
+ If S is NULL, the saved pointer in SAVE_PTR is used as
+ the next starting point. For example:
+ char s[] = "-abc-=-def";
+ char *sp;
+ x = strtok_r(s, "-", &sp); // x = "abc", sp = "=-def"
+ x = strtok_r(NULL, "-=", &sp); // x = "def", sp = NULL
+ x = strtok_r(NULL, "=", &sp); // x = NULL
+ // s = "abc\0-def\0"
+*/
+char *
+__strtok_r (char *s, const char *delim, char **save_ptr)
+{
+ char *token;
+
+ if (s == NULL)
+ s = *save_ptr;
+
+ /* Scan leading delimiters. */
+ s += strspn (s, delim);
+ if (*s == '\0')
+ {
+ *save_ptr = s;
+ return NULL;
+ }
+
+ /* Find the end of the token. */
+ token = s;
+ s = strpbrk (token, delim);
+ if (s == NULL)
+ /* This token finishes the string. */
+ *save_ptr = __rawmemchr (token, '\0');
+ else
+ {
+ /* Terminate the token and make *SAVE_PTR point past it. */
+ *s = '\0';
+ *save_ptr = s + 1;
+ }
+ return token;
+}
+#ifdef weak_alias
+libc_hidden_def (__strtok_r)
+weak_alias (__strtok_r, strtok_r)
+#endif
diff --git a/lib/gl/Makefile.am b/lib/gl/Makefile.am
index 10ae171..38a12fb 100644
--- a/lib/gl/Makefile.am
+++ b/lib/gl/Makefile.am
@@ -9,7 +9,7 @@
# the same distribution terms as the rest of that program.
#
# Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl/override
--lib=libgl --source-base=gl --m4-base=gl/m4 --doc-base=doc
--tests-base=gltests --aux-dir=build-aux --with-tests
--avoid=vc-list-files-tests --lgpl=2 --libtool --macro-prefix=gl --no-vc-files
base64 crypto/gc crypto/gc-hmac-md5 crypto/gc-hmac-sha1 crypto/gc-md5
crypto/gc-pbkdf2-sha1 crypto/gc-random crypto/gc-sha1 getline gettext
lib-msvc-compat lib-symbol-versions lib-symbol-visibility maintainer-makefile
memmem memxor minmax strverscmp vasprintf
+# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl/override
--lib=libgl --source-base=gl --m4-base=gl/m4 --doc-base=doc
--tests-base=gltests --aux-dir=build-aux --with-tests
--avoid=vc-list-files-tests --lgpl=2 --libtool --macro-prefix=gl --no-vc-files
base64 crypto/gc crypto/gc-hmac-md5 crypto/gc-hmac-sha1 crypto/gc-md5
crypto/gc-pbkdf2-sha1 crypto/gc-random crypto/gc-sha1 getline gettext
lib-msvc-compat lib-symbol-versions lib-symbol-visibility maintainer-makefile
memmem memxor minmax strnlen strverscmp vasprintf
AUTOMAKE_OPTIONS = 1.5 gnits
@@ -691,6 +691,15 @@ EXTRA_DIST += string.in.h
## end gnulib module string
+## begin gnulib module strnlen
+
+
+EXTRA_DIST += strnlen.c
+
+EXTRA_libgl_la_SOURCES += strnlen.c
+
+## end gnulib module strnlen
+
## begin gnulib module strverscmp
diff --git a/lib/gl/m4/gnulib-cache.m4 b/lib/gl/m4/gnulib-cache.m4
index 8b54b15..94ba128 100644
--- a/lib/gl/m4/gnulib-cache.m4
+++ b/lib/gl/m4/gnulib-cache.m4
@@ -15,7 +15,7 @@
# Specification in the form of a command-line invocation:
-# gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgl
--source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gltests
--aux-dir=build-aux --with-tests --avoid=vc-list-files-tests --lgpl=2 --libtool
--macro-prefix=gl --no-vc-files base64 crypto/gc crypto/gc-hmac-md5
crypto/gc-hmac-sha1 crypto/gc-md5 crypto/gc-pbkdf2-sha1 crypto/gc-random
crypto/gc-sha1 getline gettext lib-msvc-compat lib-symbol-versions
lib-symbol-visibility maintainer-makefile memmem memxor minmax strverscmp
vasprintf
+# gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgl
--source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gltests
--aux-dir=build-aux --with-tests --avoid=vc-list-files-tests --lgpl=2 --libtool
--macro-prefix=gl --no-vc-files base64 crypto/gc crypto/gc-hmac-md5
crypto/gc-hmac-sha1 crypto/gc-md5 crypto/gc-pbkdf2-sha1 crypto/gc-random
crypto/gc-sha1 getline gettext lib-msvc-compat lib-symbol-versions
lib-symbol-visibility maintainer-makefile memmem memxor minmax strnlen
strverscmp vasprintf
# Specification in the form of a few gnulib-tool.m4 macro invocations:
gl_LOCAL_DIR([gl/override])
@@ -37,6 +37,7 @@ gl_MODULES([
memmem
memxor
minmax
+ strnlen
strverscmp
vasprintf
])
diff --git a/lib/gl/m4/gnulib-common.m4 b/lib/gl/m4/gnulib-common.m4
index f8e32e3..9cc519e 100644
--- a/lib/gl/m4/gnulib-common.m4
+++ b/lib/gl/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 17
+# gnulib-common.m4 serial 18
dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -48,7 +48,9 @@ AC_DEFUN([gl_MODULE_INDICATOR_CONDITION], [1])
# a C preprocessor expression that will evaluate to 1.
AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE],
[
-
GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=gl_MODULE_INDICATOR_CONDITION
+ GNULIB_[]m4_translit([[$1]],
+ [abcdefghijklmnopqrstuvwxyz./-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=gl_MODULE_INDICATOR_CONDITION
])
# gl_MODULE_INDICATOR([modulename])
@@ -65,9 +67,12 @@ AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE],
# --------------------------------------------+---------+-----------+
AC_DEFUN([gl_MODULE_INDICATOR],
[
-
AC_DEFINE_UNQUOTED([GNULIB_]translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___]),
+ AC_DEFINE_UNQUOTED([GNULIB_]m4_translit([[$1]],
+ [abcdefghijklmnopqrstuvwxyz./-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___]),
[gl_MODULE_INDICATOR_CONDITION],
- [Define to a C preprocessor expression that evaluates to 1 or 0, depending
whether the gnulib module ]$1[ shall be considered present.])
+ [Define to a C preprocessor expression that evaluates to 1 or 0,
+ depending whether the gnulib module $1 shall be considered present.])
])
# gl_MODULE_INDICATOR_FOR_TESTS([modulename])
@@ -85,8 +90,10 @@ AC_DEFUN([gl_MODULE_INDICATOR],
# --------------------------------------------+---------+-----------+
AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS],
[
-
AC_DEFINE([GNULIB_TEST_]translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___]),
[1],
- [Define to 1 when the gnulib module ]$1[ should be tested.])
+ AC_DEFINE([GNULIB_TEST_]m4_translit([[$1]],
+ [abcdefghijklmnopqrstuvwxyz./-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___]), [1],
+ [Define to 1 when the gnulib module $1 should be tested.])
])
# m4_foreach_w
diff --git a/lib/gl/m4/gnulib-comp.m4 b/lib/gl/m4/gnulib-comp.m4
index 4b4f430..59c73c8 100644
--- a/lib/gl/m4/gnulib-comp.m4
+++ b/lib/gl/m4/gnulib-comp.m4
@@ -86,6 +86,7 @@ AC_DEFUN([gl_EARLY],
# Code from module stdlib-tests:
# Code from module string:
# Code from module string-tests:
+ # Code from module strnlen:
# Code from module strverscmp:
# Code from module strverscmp-tests:
# Code from module unistd:
@@ -215,6 +216,9 @@ AC_DEFUN([gl_INIT],
gl_STDLIB_H
# Code from module string:
gl_HEADER_STRING_H
+ # Code from module strnlen:
+ gl_FUNC_STRNLEN
+ gl_STRING_MODULE_INDICATOR([strnlen])
# Code from module strverscmp:
gl_FUNC_STRVERSCMP
gl_STRING_MODULE_INDICATOR([strverscmp])
@@ -429,6 +433,7 @@ AC_DEFUN([gl_FILE_LIST], [
lib/stdlib.in.h
lib/str-two-way.h
lib/string.in.h
+ lib/strnlen.c
lib/strverscmp.c
lib/unistd.in.h
lib/vasnprintf.c
@@ -499,6 +504,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/stdio_h.m4
m4/stdlib_h.m4
m4/string_h.m4
+ m4/strnlen.m4
m4/strverscmp.m4
m4/threadlib.m4
m4/uintmax_t.m4
diff --git a/lib/gl/m4/strnlen.m4 b/lib/gl/m4/strnlen.m4
new file mode 100644
index 0000000..cd48948
--- /dev/null
+++ b/lib/gl/m4/strnlen.m4
@@ -0,0 +1,32 @@
+# strnlen.m4 serial 10
+dnl Copyright (C) 2002-2003, 2005-2007, 2009-2010 Free Software Foundation,
+dnl Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_STRNLEN],
+[
+ dnl Persuade glibc <string.h> to declare strnlen().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
+ AC_CHECK_DECLS_ONCE([strnlen])
+ if test $ac_cv_have_decl_strnlen = no; then
+ HAVE_DECL_STRNLEN=0
+ fi
+
+ AC_FUNC_STRNLEN
+ if test $ac_cv_func_strnlen_working = no; then
+ # This is necessary because automake-1.6.1 doesn't understand
+ # that the above use of AC_FUNC_STRNLEN means we may have to use
+ # lib/strnlen.c.
+ #AC_LIBOBJ([strnlen])
+ AC_DEFINE([strnlen], [rpl_strnlen],
+ [Define to rpl_strnlen if the replacement function should be used.])
+ gl_PREREQ_STRNLEN
+ fi
+])
+
+# Prerequisites of lib/strnlen.c.
+AC_DEFUN([gl_PREREQ_STRNLEN], [:])
diff --git a/lib/gl/memxor.c b/lib/gl/strnlen.c
similarity index 60%
copy from lib/gl/memxor.c
copy to lib/gl/strnlen.c
index 7fec454..ab55e5b 100644
--- a/lib/gl/memxor.c
+++ b/lib/gl/strnlen.c
@@ -1,5 +1,6 @@
-/* memxor.c -- perform binary exclusive OR operation of two memory blocks.
- Copyright (C) 2005, 2006, 2009, 2010 Free Software Foundation, Inc.
+/* Find the length of STRING, but scan at most MAXLEN characters.
+ Copyright (C) 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
+ Written by Simon Josefsson.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@@ -15,21 +16,16 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-/* Written by Simon Josefsson. The interface was inspired by memxor
- in Niels Möller's Nettle. */
-
#include <config.h>
-#include "memxor.h"
-
-void *
-memxor (void *restrict dest, const void *restrict src, size_t n)
-{
- char const *s = src;
- char *d = dest;
+#include <string.h>
- for (; n > 0; n--)
- *d++ ^= *s++;
+/* Find the length of STRING, but scan at most MAXLEN characters.
+ If no '\0' terminator is found in that many characters, return MAXLEN. */
- return dest;
+size_t
+strnlen (const char *string, size_t maxlen)
+{
+ const char *end = memchr (string, '\0', maxlen);
+ return end ? (size_t) (end - string) : maxlen;
}
diff --git a/lib/maint.mk b/lib/maint.mk
index d633188..e121eb8 100644
--- a/lib/maint.mk
+++ b/lib/maint.mk
@@ -292,7 +292,7 @@ sc_prohibit_HAVE_MBRTOWC:
# To use this "command" macro, you must first define two shell variables:
# h: the header, enclosed in <> or ""
# re: a regular expression that matches IFF something provided by $h is used.
-define _header_without_use
+define _sc_header_without_use
dummy=; : so we do not need a semicolon before each use; \
h_esc=`echo "$$h"|sed 's/\./\\\\./g'`; \
if $(VC_LIST_EXCEPT) | grep -l '\.c$$' > /dev/null; then \
@@ -307,44 +307,44 @@ endef
# Prohibit the inclusion of assert.h without an actual use of assert.
sc_prohibit_assert_without_use:
- @h='<assert.h>' re='\<assert *\(' $(_header_without_use)
+ @h='<assert.h>' re='\<assert *\(' $(_sc_header_without_use)
# Prohibit the inclusion of close-stream.h without an actual use.
sc_prohibit_close_stream_without_use:
- @h='"close-stream.h"' re='\<close_stream *\(' $(_header_without_use)
+ @h='"close-stream.h"' re='\<close_stream *\(' $(_sc_header_without_use)
# Prohibit the inclusion of getopt.h without an actual use.
sc_prohibit_getopt_without_use:
- @h='<getopt.h>' re='\<getopt(_long)? *\(' $(_header_without_use)
+ @h='<getopt.h>' re='\<getopt(_long)? *\(' $(_sc_header_without_use)
# Don't include quotearg.h unless you use one of its functions.
sc_prohibit_quotearg_without_use:
- @h='"quotearg.h"' re='\<quotearg(_[^ ]+)? *\(' $(_header_without_use)
+ @h='"quotearg.h"' re='\<quotearg(_[^ ]+)? *\(' $(_sc_header_without_use)
# Don't include quote.h unless you use one of its functions.
sc_prohibit_quote_without_use:
- @h='"quote.h"' re='\<quote(_n)? *\(' $(_header_without_use)
+ @h='"quote.h"' re='\<quote(_n)? *\(' $(_sc_header_without_use)
# Don't include this header unless you use one of its functions.
sc_prohibit_long_options_without_use:
@h='"long-options.h"' re='\<parse_long_options *\(' \
- $(_header_without_use)
+ $(_sc_header_without_use)
# Don't include this header unless you use one of its functions.
sc_prohibit_inttostr_without_use:
@h='"inttostr.h"' re='\<(off|[iu]max|uint)tostr *\(' \
- $(_header_without_use)
+ $(_sc_header_without_use)
# Don't include this header unless you use one of its functions.
sc_prohibit_ignore_value_without_use:
@h='"ignore-value.h"' re='\<ignore_(value|ptr) *\(' \
- $(_header_without_use)
+ $(_sc_header_without_use)
# Don't include this header unless you use one of its functions.
sc_prohibit_error_without_use:
@h='"error.h"' \
re='\<error(_at_line|_print_progname|_one_per_line|_message_count)?
*\('\
- $(_header_without_use)
+ $(_sc_header_without_use)
# Don't include xalloc.h unless you use one of its functions.
# Consider these symbols:
@@ -367,7 +367,7 @@ _xa2 = X([CZ]|N?M)ALLOC
sc_prohibit_xalloc_without_use:
@h='"xalloc.h"' \
re='\<($(_xa1)|$(_xa2)) *\('\
- $(_header_without_use)
+ $(_sc_header_without_use)
# Extract function names:
# perl -lne '/^(?:extern )?(?:void|char) \*?(\w+) \(/ and print $1' lib/hash.h
@@ -378,42 +378,43 @@ _hash_struct = (struct )?\<[Hh]ash_(table|tuning)\>
sc_prohibit_hash_without_use:
@h='"hash.h"' \
re='$(_hash_fn)|$(_hash_struct)'\
- $(_header_without_use)
+ $(_sc_header_without_use)
sc_prohibit_hash_pjw_without_use:
@h='"hash-pjw.h"' \
re='\<hash_pjw *\(' \
- $(_header_without_use)
+ $(_sc_header_without_use)
sc_prohibit_safe_read_without_use:
@h='"safe-read.h"' re='(\<SAFE_READ_ERROR\>|\<safe_read *\()' \
- $(_header_without_use)
+ $(_sc_header_without_use)
sc_prohibit_argmatch_without_use:
@h='"argmatch.h"' \
re='(\<(ARRAY_CARDINALITY|X?ARGMATCH(|_TO_ARGUMENT|_VERIFY))\>|\<argmatch(_exit_fn|_(in)?valid)
*\()' \
- $(_header_without_use)
+ $(_sc_header_without_use)
sc_prohibit_canonicalize_without_use:
@h='"canonicalize.h"' \
re='CAN_(EXISTING|ALL_BUT_LAST|MISSING)|canonicalize_(mode_t|filename_mode)' \
- $(_header_without_use)
+ $(_sc_header_without_use)
sc_prohibit_root_dev_ino_without_use:
@h='"root-dev-ino.h"' \
re='(\<ROOT_DEV_INO_(CHECK|WARN)\>|\<get_root_dev_ino *\()' \
- $(_header_without_use)
+ $(_sc_header_without_use)
sc_prohibit_openat_without_use:
@h='"openat.h"' \
re='\<(openat_(permissive|needs_fchdir|(save|restore)_fail)|l?(stat|ch(own|mod))at|(euid)?accessat)\>'
\
- $(_header_without_use)
+ $(_sc_header_without_use)
# Prohibit the inclusion of c-ctype.h without an actual use.
ctype_re = isalnum|isalpha|isascii|isblank|iscntrl|isdigit|isgraph|islower\
|isprint|ispunct|isspace|isupper|isxdigit|tolower|toupper
sc_prohibit_c_ctype_without_use:
- @h='[<"]c-ctype.h[">]' re='\<c_($(ctype_re)) *\(' $(_header_without_use)
+ @h='[<"]c-ctype.h[">]' re='\<c_($(ctype_re)) *\(' \
+ $(_sc_header_without_use)
_empty =
_sp = $(_empty) $(_empty)
@@ -450,7 +451,7 @@ _sig_syms_re = $(subst $(_sp),|,$(strip $(_sig_names)
$(_sig_types_and_consts)))
sc_prohibit_signal_without_use:
@h='<signal.h>' \
re='\<($(_sig_function_re)) *\(|\<($(_sig_syms_re))\>' \
- $(_header_without_use)
+ $(_sc_header_without_use)
# Get the list of symbol names with this:
# perl -lne '/^# *define (\w+)\(/ and print $1' lib/intprops.h|grep -v '^s'|fmt
@@ -463,7 +464,7 @@ _intprops_syms_re = $(subst $(_sp),|,$(strip
$(_intprops_names)))
sc_prohibit_intprops_without_use:
@h='"intprops.h"' \
re='\<($(_intprops_syms_re)) *\(' \
- $(_header_without_use)
+ $(_sc_header_without_use)
sc_obsolete_symbols:
@re='\<(HAVE''_FCNTL_H|O''_NDELAY)\>' \
diff --git a/maint.mk b/maint.mk
index d633188..e121eb8 100644
--- a/maint.mk
+++ b/maint.mk
@@ -292,7 +292,7 @@ sc_prohibit_HAVE_MBRTOWC:
# To use this "command" macro, you must first define two shell variables:
# h: the header, enclosed in <> or ""
# re: a regular expression that matches IFF something provided by $h is used.
-define _header_without_use
+define _sc_header_without_use
dummy=; : so we do not need a semicolon before each use; \
h_esc=`echo "$$h"|sed 's/\./\\\\./g'`; \
if $(VC_LIST_EXCEPT) | grep -l '\.c$$' > /dev/null; then \
@@ -307,44 +307,44 @@ endef
# Prohibit the inclusion of assert.h without an actual use of assert.
sc_prohibit_assert_without_use:
- @h='<assert.h>' re='\<assert *\(' $(_header_without_use)
+ @h='<assert.h>' re='\<assert *\(' $(_sc_header_without_use)
# Prohibit the inclusion of close-stream.h without an actual use.
sc_prohibit_close_stream_without_use:
- @h='"close-stream.h"' re='\<close_stream *\(' $(_header_without_use)
+ @h='"close-stream.h"' re='\<close_stream *\(' $(_sc_header_without_use)
# Prohibit the inclusion of getopt.h without an actual use.
sc_prohibit_getopt_without_use:
- @h='<getopt.h>' re='\<getopt(_long)? *\(' $(_header_without_use)
+ @h='<getopt.h>' re='\<getopt(_long)? *\(' $(_sc_header_without_use)
# Don't include quotearg.h unless you use one of its functions.
sc_prohibit_quotearg_without_use:
- @h='"quotearg.h"' re='\<quotearg(_[^ ]+)? *\(' $(_header_without_use)
+ @h='"quotearg.h"' re='\<quotearg(_[^ ]+)? *\(' $(_sc_header_without_use)
# Don't include quote.h unless you use one of its functions.
sc_prohibit_quote_without_use:
- @h='"quote.h"' re='\<quote(_n)? *\(' $(_header_without_use)
+ @h='"quote.h"' re='\<quote(_n)? *\(' $(_sc_header_without_use)
# Don't include this header unless you use one of its functions.
sc_prohibit_long_options_without_use:
@h='"long-options.h"' re='\<parse_long_options *\(' \
- $(_header_without_use)
+ $(_sc_header_without_use)
# Don't include this header unless you use one of its functions.
sc_prohibit_inttostr_without_use:
@h='"inttostr.h"' re='\<(off|[iu]max|uint)tostr *\(' \
- $(_header_without_use)
+ $(_sc_header_without_use)
# Don't include this header unless you use one of its functions.
sc_prohibit_ignore_value_without_use:
@h='"ignore-value.h"' re='\<ignore_(value|ptr) *\(' \
- $(_header_without_use)
+ $(_sc_header_without_use)
# Don't include this header unless you use one of its functions.
sc_prohibit_error_without_use:
@h='"error.h"' \
re='\<error(_at_line|_print_progname|_one_per_line|_message_count)?
*\('\
- $(_header_without_use)
+ $(_sc_header_without_use)
# Don't include xalloc.h unless you use one of its functions.
# Consider these symbols:
@@ -367,7 +367,7 @@ _xa2 = X([CZ]|N?M)ALLOC
sc_prohibit_xalloc_without_use:
@h='"xalloc.h"' \
re='\<($(_xa1)|$(_xa2)) *\('\
- $(_header_without_use)
+ $(_sc_header_without_use)
# Extract function names:
# perl -lne '/^(?:extern )?(?:void|char) \*?(\w+) \(/ and print $1' lib/hash.h
@@ -378,42 +378,43 @@ _hash_struct = (struct )?\<[Hh]ash_(table|tuning)\>
sc_prohibit_hash_without_use:
@h='"hash.h"' \
re='$(_hash_fn)|$(_hash_struct)'\
- $(_header_without_use)
+ $(_sc_header_without_use)
sc_prohibit_hash_pjw_without_use:
@h='"hash-pjw.h"' \
re='\<hash_pjw *\(' \
- $(_header_without_use)
+ $(_sc_header_without_use)
sc_prohibit_safe_read_without_use:
@h='"safe-read.h"' re='(\<SAFE_READ_ERROR\>|\<safe_read *\()' \
- $(_header_without_use)
+ $(_sc_header_without_use)
sc_prohibit_argmatch_without_use:
@h='"argmatch.h"' \
re='(\<(ARRAY_CARDINALITY|X?ARGMATCH(|_TO_ARGUMENT|_VERIFY))\>|\<argmatch(_exit_fn|_(in)?valid)
*\()' \
- $(_header_without_use)
+ $(_sc_header_without_use)
sc_prohibit_canonicalize_without_use:
@h='"canonicalize.h"' \
re='CAN_(EXISTING|ALL_BUT_LAST|MISSING)|canonicalize_(mode_t|filename_mode)' \
- $(_header_without_use)
+ $(_sc_header_without_use)
sc_prohibit_root_dev_ino_without_use:
@h='"root-dev-ino.h"' \
re='(\<ROOT_DEV_INO_(CHECK|WARN)\>|\<get_root_dev_ino *\()' \
- $(_header_without_use)
+ $(_sc_header_without_use)
sc_prohibit_openat_without_use:
@h='"openat.h"' \
re='\<(openat_(permissive|needs_fchdir|(save|restore)_fail)|l?(stat|ch(own|mod))at|(euid)?accessat)\>'
\
- $(_header_without_use)
+ $(_sc_header_without_use)
# Prohibit the inclusion of c-ctype.h without an actual use.
ctype_re = isalnum|isalpha|isascii|isblank|iscntrl|isdigit|isgraph|islower\
|isprint|ispunct|isspace|isupper|isxdigit|tolower|toupper
sc_prohibit_c_ctype_without_use:
- @h='[<"]c-ctype.h[">]' re='\<c_($(ctype_re)) *\(' $(_header_without_use)
+ @h='[<"]c-ctype.h[">]' re='\<c_($(ctype_re)) *\(' \
+ $(_sc_header_without_use)
_empty =
_sp = $(_empty) $(_empty)
@@ -450,7 +451,7 @@ _sig_syms_re = $(subst $(_sp),|,$(strip $(_sig_names)
$(_sig_types_and_consts)))
sc_prohibit_signal_without_use:
@h='<signal.h>' \
re='\<($(_sig_function_re)) *\(|\<($(_sig_syms_re))\>' \
- $(_header_without_use)
+ $(_sc_header_without_use)
# Get the list of symbol names with this:
# perl -lne '/^# *define (\w+)\(/ and print $1' lib/intprops.h|grep -v '^s'|fmt
@@ -463,7 +464,7 @@ _intprops_syms_re = $(subst $(_sp),|,$(strip
$(_intprops_names)))
sc_prohibit_intprops_without_use:
@h='"intprops.h"' \
re='\<($(_intprops_syms_re)) *\(' \
- $(_header_without_use)
+ $(_sc_header_without_use)
sc_obsolete_symbols:
@re='\<(HAVE''_FCNTL_H|O''_NDELAY)\>' \
hooks/post-receive
--
GNU gsasl
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [SCM] GNU gsasl branch, master, updated. gsasl-1-4-1-108-gd133ad1,
Simon Josefsson <=