mingw: do not crash on open(NULL, ...)
commit0a0c4aa6b74647bfffce7db44333dc173a8c119a
authorErik Faye-Lund <kusmabite@gmail.com>
Thu, 23 Sep 2010 17:35:25 +0000 (23 17:35 +0000)
committerPat Thoyts <patthoyts@users.sourceforge.net>
Fri, 1 Oct 2010 22:21:35 +0000 (1 23:21 +0100)
tree568e967ac45d6f05cd95cf3ce6bb4c7747641a83
parent9e480700345441ebe146f0d9b86a297b2020ea4e
mingw: do not crash on open(NULL, ...)

fetch_and_setup_pack_index() apparently pass a NULL-pointer to
parse_pack_index(), which in turn pass it to check_packed_git_idx(),
which again pass it to open(). Since open() already sets errno
correctly for the NULL-case, let's just avoid the problematic strcmp.

[PT: squashed in fix for freopen which was missed first time round]

Acked-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
compat/mingw.c