mingw: do not crash on open(NULL, ...)
commit1958254b61202d3b7fd0749e62545865717c7301
authorErik Faye-Lund <kusmabite@gmail.com>
Thu, 23 Sep 2010 17:35:25 +0000 (23 17:35 +0000)
committerPat Thoyts <patthoyts@users.sourceforge.net>
Sun, 24 Oct 2010 23:04:11 +0000 (25 00:04 +0100)
tree315ee100ee42991372756ebe27a489c25750c225
parent7d42fa83fbbdc43a78d0940c1324e4deb1eef9e7
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