diff options
author | Simon Josefsson <simon@josefsson.org> | 2007-02-06 16:06:02 +0000 |
---|---|---|
committer | Simon Josefsson <simon@josefsson.org> | 2007-02-06 16:06:02 +0000 |
commit | 2b153011c23c97f63ac8101db0d81be202db70fc (patch) | |
tree | f72617b70b6ef5ab09a7d69a4b59a2a2fa3b40e0 /lgl | |
parent | 54b11ca4dfc7b48fcf0a73eaaf9f0dfb50e488d2 (diff) | |
download | gnutls-2b153011c23c97f63ac8101db0d81be202db70fc.tar.gz |
Update.
Diffstat (limited to 'lgl')
-rw-r--r-- | lgl/Makefile.am | 1 | ||||
-rw-r--r-- | lgl/m4/string_h.m4 | 1 | ||||
-rw-r--r-- | lgl/string_.h | 28 |
3 files changed, 29 insertions, 1 deletions
diff --git a/lgl/Makefile.am b/lgl/Makefile.am index 4289690538..105f71ae58 100644 --- a/lgl/Makefile.am +++ b/lgl/Makefile.am @@ -289,6 +289,7 @@ string.h: string_.h -e 's|@''GNULIB_MBSCSPN''@|$(GNULIB_MBSCSPN)|g' \ -e 's|@''GNULIB_MBSPBRK''@|$(GNULIB_MBSPBRK)|g' \ -e 's|@''GNULIB_MBSSPN''@|$(GNULIB_MBSSPN)|g' \ + -e 's|@''GNULIB_MBSSEP''@|$(GNULIB_MBSSEP)|g' \ -e 's|@''GNULIB_MBSTOK_R''@|$(GNULIB_MBSTOK_R)|g' \ -e 's|@''GNULIB_MEMMEM''@|$(GNULIB_MEMMEM)|g' \ -e 's|@''GNULIB_MEMPCPY''@|$(GNULIB_MEMPCPY)|g' \ diff --git a/lgl/m4/string_h.m4 b/lgl/m4/string_h.m4 index 14ed54ad54..80e95e1bb2 100644 --- a/lgl/m4/string_h.m4 +++ b/lgl/m4/string_h.m4 @@ -75,5 +75,6 @@ AC_DEFUN([gl_STRING_MODULE_INDICATOR_DEFAULTS], GNULIB_MBSCSPN=0; AC_SUBST([GNULIB_MBSCSPN]) GNULIB_MBSPBRK=0; AC_SUBST([GNULIB_MBSPBRK]) GNULIB_MBSSPN=0; AC_SUBST([GNULIB_MBSSPN]) + GNULIB_MBSSEP=0; AC_SUBST([GNULIB_MBSSEP]) GNULIB_MBSTOK_R=0; AC_SUBST([GNULIB_MBSTOK_R]) ]) diff --git a/lgl/string_.h b/lgl/string_.h index 3a35f49bfa..f3cd465b0d 100644 --- a/lgl/string_.h +++ b/lgl/string_.h @@ -270,6 +270,12 @@ extern char *strpbrk (char const *__s, char const *__accept); # if ! @HAVE_STRSEP@ extern char *strsep (char **restrict __stringp, char const *restrict __delim); # endif +# if defined GNULIB_POSIXCHECK +# undef strsep +# define strsep(s,d) \ + (GL_LINK_WARNING ("strsep cannot work correctly on character strings in multibyte locales - use mbssep if you care about internationalization"), \ + strsep (s, d)) +# endif #elif defined GNULIB_POSIXCHECK # undef strsep # define strsep strsep_is_unportable__use_gnulib_module_strsep_for_portability @@ -415,6 +421,24 @@ extern char * mbspbrk (const char *string, const char *accept); extern size_t mbsspn (const char *string, const char *reject); #endif +#if @GNULIB_MBSSEP@ +/* Search the next delimiter (multibyte character listed in the character + string DELIM) starting at the character string *STRINGP. + If one is found, overwrite it with a NUL, and advance *STRINGP to point + to the next multibyte character after it. Otherwise, set *STRINGP to NULL. + If *STRINGP was already NULL, nothing happens. + Return the old value of *STRINGP. + + This is a variant of mbstok_r() that supports empty fields. + + Caveat: It modifies the original string. + Caveat: These functions cannot be used on constant strings. + Caveat: The identity of the delimiting character is lost. + + See also mbstok_r(). */ +extern char * mbssep (char **stringp, const char *delim); +#endif + #if @GNULIB_MBSTOK_R@ /* Parse the character string STRING into tokens separated by characters in the character string DELIM. @@ -429,7 +453,9 @@ extern size_t mbsspn (const char *string, const char *reject); Caveat: It modifies the original string. Caveat: These functions cannot be used on constant strings. - Caveat: The identity of the delimiting character is lost. */ + Caveat: The identity of the delimiting character is lost. + + See also mbssep(). */ extern char * mbstok_r (char *string, const char *delim, char **save_ptr); #endif |