Permalink
Browse files

Fixed bug #63248 Load multiple magic files on win

- adapt config.w32 to not to use dirent lib anymore
- prevent libmagic from opening a dir handle under win
- reimplement the dir iteration functionality with streams
  • Loading branch information...
1 parent 13d4d8e commit 6d019deee206dd76396bcaff9497ae3619d279b0 @weltling weltling committed Oct 16, 2012
Showing with 142 additions and 107 deletions.
  1. +4 −0 NEWS
  2. +10 −16 ext/fileinfo/config.w32
  3. +104 −77 ext/fileinfo/libmagic.patch
  4. +24 −14 ext/fileinfo/libmagic/apprentice.c
View
4 NEWS
@@ -2,6 +2,10 @@ PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2012, PHP 5.4.9
+- Fileinfo:
+ . Fixed bug #63248 (Load multiple magic files from a directory under Windows).
+ (Anatoliy)
+
?? ??? 2012, PHP 5.4.8
- CLI server:
View
@@ -4,22 +4,16 @@
ARG_ENABLE("fileinfo", "fileinfo support", "no");
if (PHP_FILEINFO != 'no') {
- if (CHECK_HEADER_ADD_INCLUDE("dirent.h", "CFLAGS_FILEINFO") &&
- CHECK_LIB("dirent_a.lib", "fileinfo", PHP_FILEINFO)) {
- LIBMAGIC_SOURCES=" apprentice.c apptype.c ascmagic.c \
- cdf.c cdf_time.c compress.c \
- encoding.c fsmagic.c funcs.c \
- is_tar.c magic.c print.c \
- readcdf.c readelf.c softmagic.c";
+ LIBMAGIC_SOURCES=" apprentice.c apptype.c ascmagic.c \
+ cdf.c cdf_time.c compress.c \
+ encoding.c fsmagic.c funcs.c \
+ is_tar.c magic.c print.c \
+ readcdf.c readelf.c softmagic.c";
- if (VCVERS < 1500) {
- ADD_FLAG('CFLAGS', '/Zm1000');
- }
+ if (VCVERS < 1500) {
+ ADD_FLAG('CFLAGS', '/Zm1000');
+ }
- EXTENSION('fileinfo', 'fileinfo.c', true, "/I" + configure_module_dirname + "/libmagic /I" + configure_module_dirname);
- ADD_SOURCES(configure_module_dirname + '\\libmagic', LIBMAGIC_SOURCES, "fileinfo");
- } else {
- WARNING("fileinfo not enabled; libraries and headers not found");
- PHP_FILEINFO = "no";
- }
+ EXTENSION('fileinfo', 'fileinfo.c', true, "/I" + configure_module_dirname + "/libmagic /I" + configure_module_dirname);
+ ADD_SOURCES(configure_module_dirname + '\\libmagic', LIBMAGIC_SOURCES, "fileinfo");
}
Oops, something went wrong.

0 comments on commit 6d019de

Please sign in to comment.