CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Guillaume Melquiond <[EMAIL PROTECTED]> 05/07/12 20:54:16
Modified files:
src : filesystem.cpp
Log message:
Log an error when a file opening failed.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/filesystem.cpp.diff?tr1=1.75&tr2=1.76&r1=text&r2=text
Patches:
Index: wesnoth/src/filesystem.cpp
diff -u wesnoth/src/filesystem.cpp:1.75 wesnoth/src/filesystem.cpp:1.76
--- wesnoth/src/filesystem.cpp:1.75 Sat Jul 2 21:37:18 2005
+++ wesnoth/src/filesystem.cpp Tue Jul 12 20:54:15 2005
@@ -1,4 +1,4 @@
-/* $Id: filesystem.cpp,v 1.75 2005/07/02 21:37:18 ott Exp $ */
+/* $Id: filesystem.cpp,v 1.76 2005/07/12 20:54:15 silene Exp $ */
/*
Copyright (C) 2003 by David White <[EMAIL PROTECTED]>
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
@@ -440,7 +440,10 @@
// FIXME: why do we rely on this even with relative paths ?
// still useful with zipios, for things like cache and prefs
- return new std::ifstream(fname.c_str(),std::ios_base::binary);
+ std::istream *s = new std::ifstream(fname.c_str(),
std::ios_base::binary);
+ if (s->fail())
+ ERR_FS << "streaming " << fname << " failed.\n";
+ return s;
}
std::string read_file(std::string const &fname)