standards/57911: fnmatch ("[[:alpha:]]","x", FNM_PATHNAME) returns FNM_NOMATCH

David Gardner david at pinko.net
Sun Oct 12 13:10:28 PDT 2003


>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:


More information about the freebsd-standards mailing list