A few fixes.

This commit is contained in:
Michael Kerrisk 2006-05-22 08:53:01 +00:00
parent 7cd244034d
commit 3e2984b2dd
1 changed files with 5 additions and 1 deletions

View File

@ -43,6 +43,10 @@ user-supplied response, perhaps obtained with \fBfgets\fP(3) or
The user's language preference is taken into account per the
environment variables \fBLANG\fP, \fBLC_MESSAGES\fP, and \fBLC_ALL\fP,
if the program has called \fBsetlocale\fP() to effect their changes.
Regardless of the locale, responses matching \fB^[Yy]\fP are always
accepted as affirmative, and those matching \fB^[Nn]\fP are always
accepted as negative.
.SH "RETURN VALUE"
After examining
.IR response ,
@ -70,7 +74,7 @@ of \fIresponse\fP. As a consequence, "nyes" returns 0, and
It would be preferable to accept input strings much more
strictly, for example (using the extended regular
expression notation described in \fBregex\fP(7)):
\fB([yY]|yes|YES)\fP and \fB([nN]|no|NO)\fP.
\fB^([yY]|yes|YES)$\fP and \fB^([nN]|no|NO)$\fP.
.SH EXAMPLE PROGRAM
The following program displays the results when
.BR rpmatch ()