This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/18239] New: fnmatch does not treat [: specially inside a bracket expression
- From: "nszabolcs at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Fri, 10 Apr 2015 11:11:44 +0000
- Subject: [Bug libc/18239] New: fnmatch does not treat [: specially inside a bracket expression
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=18239
Bug ID: 18239
Summary: fnmatch does not treat [: specially inside a bracket
expression
Product: glibc
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: libc
Assignee: unassigned at sourceware dot org
Reporter: nszabolcs at gmail dot com
CC: drepper.fsp at gmail dot com
"[[:a]" is an invalid fnmatch pattern because [: must start a correct character
class expression.
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_03_05
the following code prints:
should be an error, got 0
#define _POSIX_C_SOURCE 200809L
#include <fnmatch.h>
#include <stdio.h>
int main()
{
// XBD 9.3.5 rule 1. "[:" is special
int r = fnmatch("[[:a]", "a", 0);
if (r == 0 || r == FNM_NOMATCH)
printf("should be an error, got %d\n", r);
}
--
You are receiving this mail because:
You are on the CC list for the bug.