From 4287ed1ecbe21e7e90b9420b267edf8fe1482b71 Mon Sep 17 00:00:00 2001 From: Nguyễn Thái Ngọc Duy Date: Thu, 23 Apr 2009 03:01:21 +1000 Subject: mingw.c: make fopen support /dev/null (needed for cmp iirc) --- libbb/mingw.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libbb') diff --git a/libbb/mingw.c b/libbb/mingw.c index eb239bbd6..62aad5d7e 100644 --- a/libbb/mingw.c +++ b/libbb/mingw.c @@ -150,6 +150,14 @@ int mingw_open (const char *filename, int oflags, ...) return fd; } +#undef fopen +FILE *mingw_fopen (const char *filename, const char *mode) +{ + if (!strcmp(filename, "/dev/null")) + filename = "nul"; + return fopen(filename, mode); +} + #undef close int mingw_close (int fd) { -- cgit v1.2.3-55-g6feb