[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-gnulib] strtok_r
From: |
Bruno Haible |
Subject: |
Re: [Bug-gnulib] strtok_r |
Date: |
Thu, 11 Nov 2004 21:52:16 +0100 |
User-agent: |
KMail/1.5 |
Simon Josefsson asked:
> Opinions?
I agree this is useful gnulib, because strtok() is so misdesigned.
About the .h file:
> +#if defined HAVE_DECL_STRTOK_R && !HAVE_DECL_STRTOK_R
What does the first half of this test mean? HAVE_DECL_STRTOK_R is meant
to be defined to either 0 or 1 in config.h, so what's the purpose of the
test?
Furthermore, it's lacking good documentation. Since I'm too lazy to write
one, maybe you can add the reference to the POSIX description at
http://www.opengroup.org/onlinepubs/009695399/functions/strtok.html
Also, it would be good to add the caveats, partially found in the Linux
man page:
/* This is a variant of strtok() that is multithread-safe.
Caveat: It modifies the original string.
Caveat: It doesn't work with multibyte strings unless all of the delimiter
characters are ASCII characters < 0x30.
See also strsep(). */
I'm adding a "See also" in the opposite direction as well.
Bruno
Re: [Bug-gnulib] strtok_r, Paul Eggert, 2004/11/11