Robert Elz <> wrote, on 13 Apr 2018:
>     Date:        Fri, 13 Apr 2018 15:07:07 +0100
>     From:        Geoff Clare <>
>   | For those the only difference from REs is the '^' -> '!'  one,
> Not for fnmatch() which can have \ to escape characters (anywhere
> according to its description, which would include in bracket expressions,
> as that is not excluded.

Clearly the statement in XBD 9.3.5:

    The special characters '.', '*', '[', and '\\' ( <period>,
    <asterisk>, <left-square-bracket>, and <backslash>, respectively)
    shall lose their special meaning within a bracket expression.

is intended to apply to backslashes in fnmatch(), just as it does to
the special meaning of backslash stated in XCU 2.13.1 (which also
doesn't mention an exception for bracket expressions).

The whole point of adding fnmatch() to the standard was to provide a
a function which implements XCU 2.13, so any interpretation of the
standard which has backslash being treated differently in fnmatch()
(without FNM_NOESCAPE) than in XCU 2.13 cannot be correct.

While quoting it here, I just noticed that this statement also has
another issue when being read in the context of XCU 2.13.1: it should
refer to '?' losing its special meaning instead of '.'.  I'll update
my proposed change in bug 1190 to address that.

Geoff Clare <>
The Open Group, Apex Plaza, Forbury Road, Reading, RG1 1AX, England

Reply via email to