This is an automated email from the ASF dual-hosted git repository. xiaoxiang781216 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 23f5a4f06dffa041811e581db024aa0c72e51d19 Author: Marco Casaroli <[email protected]> AuthorDate: Tue Oct 20 18:28:06 2026 +0200 Documentation: Describe fnmatch(). Add a page for the fnmatch() of libc: the pattern syntax that it supports, the flags FNM_CASEFOLD and FNM_LEADING_DIR, and the flags that have no effect. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Marco Casaroli <[email protected]> --- Documentation/os/libs/libc/fnmatch.rst | 28 ++++++++++++++++++++++++++++ Documentation/os/libs/libc/index.rst | 1 + 2 files changed, 29 insertions(+) diff --git a/Documentation/os/libs/libc/fnmatch.rst b/Documentation/os/libs/libc/fnmatch.rst new file mode 100644 index 00000000000..f2bad232b0e --- /dev/null +++ b/Documentation/os/libs/libc/fnmatch.rst @@ -0,0 +1,28 @@ +======= +fnmatch +======= + +``fnmatch()`` in ``libs/libc/misc/lib_fnmatch.c`` matches a string against +a shell-style pattern. It is a small matcher, not a full POSIX +implementation. + +Patterns +-------- + +- ``?`` matches one character. +- ``*`` matches any number of characters, but not ``/``. +- ``**`` matches any number of characters, ``/`` included. +- ``[...]`` matches one character of a set. A set can hold characters and + ranges, for example ``[a-zA-Z_]``. ``[!...]`` is not supported. +- ``|`` separates patterns: the string matches if one of them matches. +- The other characters match themselves. A backslash is not special. + +Flags +----- + +- ``FNM_CASEFOLD`` (or ``FNM_IGNORECASE``): upper and lower case letters + are the same, also in sets and ranges. +- ``FNM_LEADING_DIR``: the pattern can match the string up to a ``/``, so + ``usr/lib`` matches ``usr/lib/x``. +- ``FNM_PATHNAME``, ``FNM_PERIOD`` and ``FNM_NOESCAPE`` are defined but + have no effect. diff --git a/Documentation/os/libs/libc/index.rst b/Documentation/os/libs/libc/index.rst index 94cb90641a7..a8ce70b999c 100644 --- a/Documentation/os/libs/libc/index.rst +++ b/Documentation/os/libs/libc/index.rst @@ -194,6 +194,7 @@ Implementation Details :maxdepth: 1 :caption: Contents: + fnmatch.rst popen.rst search.rst stdbit.rst
