This is the mail archive of the glibc-bugs@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/542] Fix to strtok_r.c to make it possible to use in gnulib


------- Additional Comments From simon at josefsson dot org  2004-11-12 00:16 -------
Thanks!  Here is a small addition to improve the documentation the comment, too.

Index: sysdeps/generic/strtok_r.c
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/generic/strtok_r.c,v
retrieving revision 1.13
diff -u -p -r1.13 strtok_r.c
--- sysdeps/generic/strtok_r.c  11 Nov 2004 22:15:46 -0000      1.13
+++ sysdeps/generic/strtok_r.c  12 Nov 2004 00:15:52 -0000
@@ -42,6 +42,17 @@
        x = strtok_r(NULL, "-=", &sp);  // x = "def", sp = NULL
        x = strtok_r(NULL, "=", &sp);   // x = NULL
                // s = "abc\0-def\0"
+
+   For the POSIX documentation for this function, see:
+   http://www.opengroup.org/onlinepubs/009695399/functions/strtok.html
+
+   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: It doesn't work with multibyte strings unless all of the delimiter
+           characters are ASCII characters < 0x80.
+
+   See also strsep().
 */
 char *
 __strtok_r (char *s, const char *delim, char **save_ptr)


-- 


http://sources.redhat.com/bugzilla/show_bug.cgi?id=542

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]