From 8c4e251472f88df545178f32d22de86c2e6b323f Mon Sep 17 00:00:00 2001 From: Blue Rats Date: Fri, 2 Nov 2012 23:51:45 +0000 Subject: [PATCH] Patch to fix bug in zero length files. From the AriaMaestosa project. --- irrxml/patches/patch-src_irrXML.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 irrxml/patches/patch-src_irrXML.cpp diff --git a/irrxml/patches/patch-src_irrXML.cpp b/irrxml/patches/patch-src_irrXML.cpp new file mode 100644 index 0000000000..6372c578d6 --- /dev/null +++ b/irrxml/patches/patch-src_irrXML.cpp @@ -0,0 +1,17 @@ +$NetBSD: patch-src_irrXML.cpp,v 1.1 2012/11/02 23:51:45 othyro Exp $ + +Fixes bug if filesize is 0. + +--- src/irrXML.cpp.orig 2005-08-20 21:17:54.000000000 +0000 ++++ src/irrXML.cpp +@@ -83,7 +83,9 @@ private: + //! Creates an instance of an UFT-8 or ASCII character xml parser. + IrrXMLReader* createIrrXMLReader(const char* filename) + { +- return new CXMLReaderImpl(new CFileReadCallBack(filename)); ++ CFileReadCallBack* file = new CFileReadCallBack(filename); ++ if (file->getSize() == 0) return NULL; ++ return new CXMLReaderImpl(file); + } + +