diff options
author | Johannes Sixt <j6t@kdbg.org> | 2010-02-25 21:03:44 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-02-25 12:27:38 -0800 |
commit | 3fdcdbdf301dadb7af58fe038501f0af6419a2e0 (patch) | |
tree | a93e6858dfc1b9db2bd6fd71eff8a3ece8d2f9d5 /compat/mingw.h | |
parent | Merge branch 'maint' (diff) | |
download | tgif-3fdcdbdf301dadb7af58fe038501f0af6419a2e0.tar.xz |
Windows: redirect f[re]open("/dev/null") to f[re]open("nul")
On Windows, the equivalent of "/dev/null" is "nul". This implements
compatibility wrappers around fopen() and freopen() that check for this
particular file name.
The new tests exercise code paths where this is relevant.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'compat/mingw.h')
-rw-r--r-- | compat/mingw.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compat/mingw.h b/compat/mingw.h index e254fb4e06..e81e752ed2 100644 --- a/compat/mingw.h +++ b/compat/mingw.h @@ -170,6 +170,12 @@ int link(const char *oldpath, const char *newpath); int mingw_open (const char *filename, int oflags, ...); #define open mingw_open +FILE *mingw_fopen (const char *filename, const char *otype); +#define fopen mingw_fopen + +FILE *mingw_freopen (const char *filename, const char *otype, FILE *stream); +#define freopen mingw_freopen + char *mingw_getcwd(char *pointer, int len); #define getcwd mingw_getcwd |