summaryrefslogtreecommitdiff
path: root/ext/fileinfo/libmagic/apprentice.c
diff options
context:
space:
mode:
authorAnatoliy Belsky <ab@php.net>2012-11-27 16:33:58 +0100
committerAnatoliy Belsky <ab@php.net>2012-11-27 16:33:58 +0100
commite6b727d3b7eef06d8b7b6a4638a95e7a571d97b5 (patch)
tree3b181a41d663f18bb03e87e629806ae670fb5d0b /ext/fileinfo/libmagic/apprentice.c
parenteff12e56b63531ca70f2bc55bbb59366b65191e0 (diff)
downloadphp-git-e6b727d3b7eef06d8b7b6a4638a95e7a571d97b5.tar.gz
Fixed bug #63590 Fileinfo delivers ifferent results in TS and NTS under Windows
Diffstat (limited to 'ext/fileinfo/libmagic/apprentice.c')
-rw-r--r--ext/fileinfo/libmagic/apprentice.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/fileinfo/libmagic/apprentice.c b/ext/fileinfo/libmagic/apprentice.c
index ee1ad4d6e8..e88a3e6c86 100644
--- a/ext/fileinfo/libmagic/apprentice.c
+++ b/ext/fileinfo/libmagic/apprentice.c
@@ -2406,7 +2406,11 @@ mkdbname(struct magic_set *ms, const char *fn, int strip)
/* Compatibility with old code that looked in .mime */
if (ms->flags & MAGIC_MIME) {
spprintf(&buf, MAXPATHLEN, "%.*s.mime%s", (int)(q - fn), fn, ext);
+#ifdef PHP_WIN32
+ if (VCWD_ACCESS(buf, R_OK) == 0) {
+#else
if (VCWD_ACCESS(buf, R_OK) != -1) {
+#endif
ms->flags &= MAGIC_MIME_TYPE;
return buf;
}