Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Oct 2003 13:04:12 -0700
From:      "David Gardner" <david@pinko.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   standards/57911: fnmatch ("[[:alpha:]]","x", FNM_PATHNAME) returns FNM_NOMATCH
Message-ID:  1065989051@eden
Resent-Message-ID: <200310122010.h9CKAOdn030320@freefall.freebsd.org>

| raw e-mail | index | archive | help

>Number:         57911
>Category:       standards
>Synopsis:       fnmatch ("[[:alpha:]]","x", FNM_PATHNAME) returns FNM_NOMATCH
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-standards
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Oct 12 13:10:23 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator:     David Gardner
>Release:        FreeBSD 4.8-RELEASE i386
>Organization:
na 
>Environment:


System: FreeBSD eden 4.8-RELEASE FreeBSD 4.8-RELEASE #3: Thu Jun i386  
>From fnmatch.h: src/include/fnmatch.h,v 1.9 1999/11/21 17:32:45 fnmatch.h   8.1 (Berkeley) 6/2/93

g++ version 2.95.4
gcc version 3.0.4



>Description:


The fnmatch function doesn't seem to like any of the character classes that are listed in the re_format man page. I ssh'ed to a linux box to check this and the character classes behaved the way I expected them to.



>How-To-Repeat:


#include <iostream>
#include <fnmatch.h>
void main () {  
  int result = fnmatch ("[[:alpha:]]","x", FNM_PATHNAME);
  if (result == FNM_NOMATCH)
    cout << "failed" << endl;
  else
    cout << "passed" << endl;
}



>Fix:


  fnmatch seems to like the expression "[A-Za-z]" which is equivelent to "[[:alpha:]]".



>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1065989051>