Skip to content

Commit

Permalink
1209 fnmatch(3C) should mention FNM_IGNORECASE
Browse files Browse the repository at this point in the history
Reviewed by: Marcel Telka <marcel@telka.sk>
Approved by: Robert Mustacchi <rm@joyent.com>
  • Loading branch information
sergioag authored and rmustacc committed Jun 12, 2015
1 parent 0afb687 commit b735fab
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions usr/src/man/man3c/fnmatch.3c
Expand Up @@ -7,7 +7,7 @@
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH FNMATCH 3C "Jul 24, 2002"
.TH FNMATCH 3C "Jun 11, 2015"
.SH NAME
fnmatch \- match filename or path name
.SH SYNOPSIS
Expand All @@ -19,7 +19,6 @@ fnmatch \- match filename or path name
.fi

.SH DESCRIPTION
.sp
.LP
The \fBfnmatch()\fR function matches patterns as described on the
\fBfnmatch\fR(5) manual page. It checks the \fIstring\fR argument to see if it
Expand All @@ -43,6 +42,21 @@ by a slash in \fIpattern\fR; it will not be matched by either the asterisk
If not set, the slash character is treated as an ordinary character.
.RE

.sp
.ne 2
.na
\fB\fBFNM_IGNORECASE\fR\fR
.ad
.RS 18n
If set, the \fIstring\fR will be transliterated to lower case before doing the
actual match. This transliteration is done using \fBtowlower_l\fR(3C), using
the locale of the current thread. If no locale is set, then the global locale
is used instead.
.sp
If not set, the match will use \fIstring\fR with no changes, making the match
case-sensitive.
.RE

.sp
.ne 2
.na
Expand Down Expand Up @@ -82,17 +96,15 @@ character of \fIstring\fR.
.RE

.sp
.LP
.RS 18n
If not set, no special restrictions are placed on matching a period.
.SH RETURN VALUES
.sp
.LP
If \fIstring\fR matches the pattern specified by \fIpattern\fR, then
\fBfnmatch()\fR returns \fB0\fR. If there is no match, \fBfnmatch()\fR returns
\fBFNM_NOMATCH\fR, which is defined in the header <\fBfnmatch.h\fR>. If an
error occurs, \fBfnmatch()\fR returns another non-zero value.
.SH USAGE
.sp
.LP
The \fBfnmatch()\fR function has two major uses. It could be used by an
application or utility that needs to read a directory and apply a pattern
Expand All @@ -112,7 +124,6 @@ treatment for period at the beginning of a filename.
The \fBfnmatch()\fR function can be used safely in multithreaded applications,
as long as \fBsetlocale\fR(3C) is not being called to change the locale.
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
Expand All @@ -132,7 +143,6 @@ MT-Level MT-Safe with exceptions
.TE

.SH SEE ALSO
.sp
.LP
\fBfind\fR(1), \fBpax\fR(1), \fBglob\fR(3C), \fBsetlocale\fR(3C),
\fBwordexp\fR(3C), \fBattributes\fR(5), \fBfnmatch\fR(5), \fBstandards\fR(5)

0 comments on commit b735fab

Please sign in to comment.