Add compat/fopen.c which returns NULL on attempt to open directory
[gitweb.git] / git-compat-util.h
index 4df90cb34e61deb56ecb49797e48e67bdc98ff3b..46d5e93c729ec8625eda0649071c887cbcbe8015 100644 (file)
@@ -204,6 +204,11 @@ void *gitmemmem(const void *haystack, size_t haystacklen,
                 const void *needle, size_t needlelen);
 #endif
 
+#ifdef FREAD_READS_DIRECTORIES
+#define fopen(a,b) git_fopen(a,b)
+extern FILE *git_fopen(const char*, const char*);
+#endif
+
 #ifdef __GLIBC_PREREQ
 #if __GLIBC_PREREQ(2, 1)
 #define HAVE_STRCHRNUL