php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22384 FNM_CASEFOLD is not available
Submitted: 2003-02-23 01:36 UTC Modified: 2003-02-28 02:36 UTC
From: polone at townnews dot com Assigned: hholzgra (profile)
Status: Closed Package: Directory function related
PHP Version: 4.3.1 OS: RedHat Linux 7.3
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
18 + 3 = ?
Subscribe to this entry?

 
 [2003-02-23 01:36 UTC] polone at townnews dot com
The predefined constant FNM_CASEFOLD does not exist for the fnmatch() function. The function call does work by calling the function using:

fnmatch('pattern*','match-this', 16);

At least, on RedHat Linux this will work because the flag is a left bit shift 1 << 4. Probably just not defined in the PHP extension as a flag (although I haven't checked).

The flag allows case-insensitive comparisons to the string being matched. Using the integer constant directly shouldn't break anything if the constant is later added, just an annoyance as far as looking at source is concerned.

Regards,

Patrick O'Lone

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-02-23 02:30 UTC] sniper@php.net
From my fnmatch.h (rh 6.2):

#if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE
# define FNM_FILE_NAME   FNM_PATHNAME   /* Preferred GNU name.  */
# define FNM_LEADING_DIR (1 << 3)       /* Ignore `/...' after a match.  */
# define FNM_CASEFOLD    (1 << 4)       /* Compare without regard to case.  */
#endif

Maybe we should add '#define _GNU_SOURCE' before including the fnmatch.h in ext/standard/file.c ??
Assigned for Hartmut who's responsible for adding this function.. :)

 [2003-02-28 02:36 UTC] hholzgra@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 17:01:29 2024 UTC