tags 367851 fixed-upstream thanks Justin,
> Find attached a patch to document strchrnul.3; please consider > including it. Thanks, added for upstream 2.33. > --- - 2006-05-17 23:22:33.816543000 -0400 > +++ /home/pryzbyj/man/strchr.3 2006-05-17 23:21:31.000000000 -0400 > @@ -25,19 +25,24 @@ > .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) > .\" 386BSD man pages > .\" Modified Mon Apr 12 12:51:24 1993, David Metcalfe > -.TH STRCHR 3 1993-04-12 "" "Linux Programmer's Manual" > +.\" Modified Wed May 17 23:00:50 2006, Justin Pryzby > +.\" <[EMAIL PROTECTED]> > +.TH STRCHR 3 1993-04-12 "GNU" "Linux Programmer's Manual" > .SH NAME > -strchr, strrchr \- locate character in string > +strchr, strrchr, strchrnul \- locate character in string Applied. An important point to remember when adding a new function to an existing page is to remind me to add a new link! But I remembered this time. > .SH SYNOPSIS > .nf > .B #include <string.h> > .sp > .BI "char *strchr(const char *" s ", int " c ); > -.sp > .BI "char *strrchr(const char *" s ", int " c ); > +.sp > +.B #define _GNU_SOURCE > +.BI "char *strchrnul(const char *" s ", int " c ); Better is: .B #define _GNU_SOURCE .B #include <string.h> .sp .BI "char *strrchr(const char *" s ", int " c ); to emphasize that the feature test macro must be defined before including the header file. > .fi > .SH DESCRIPTION > -The \fBstrchr\fP() function returns a pointer to the first occurrence > +The \fBstrchr\fP() and \fPstrchrnul\fP() functions return pointers to > +the first occurrence > of the character \fIc\fP in the string \fIs\fP. I wrote this differently, as a para lower down: The \fBstrchrnul\fP() function is like \fBstrchr\fP() except that if \fIc\fP is not found in \fIs\fP, then it returns a pointer to the null byte at the end of \fIs\fP, rather than NULL. > .PP > The \fBstrrchr\fP() function returns a pointer to the last occurrence > @@ -48,8 +53,14 @@ > .SH "RETURN VALUE" > The \fBstrchr\fP() and \fBstrrchr\fP() functions return a pointer to > the matched character or NULL if the character is not found. > +\fBstrchr\fP() returns a pointer to the given character, or a pointer typo. > +to the null character at the end of the string if it is not found > +(that is, \fIs\fB+strlen(\fPs\fP)\fR). > .SH "CONFORMING TO" > SVID 3, POSIX, 4.3BSD, ISO 9899 > + > +\fBstrchr\fP() is specific to glibc, and should not be used in typo > +programs intended to be portable. > .SH "SEE ALSO" > .BR index (3), > .BR memchr (3), > @@ -58,6 +69,7 @@ > .BR strsep (3), > .BR strspn (3), > .BR strstr (3), > +.BR strlen (3), Applied. > .BR strtok (3), > .BR wcschr (3), > .BR wcsrchr (3) Thanks. Michael -- Michael Kerrisk maintainer of Linux man pages Sections 2, 3, 4, 5, and 7 Want to help with man page maintenance? Grab the latest tarball at ftp://ftp.win.tue.nl/pub/linux-local/manpages/, read the HOWTOHELP file and grep the source files for 'FIXME'. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]