wesnoth-cvs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-cvs-commits] wesnoth/src filesystem.cpp


From: David White
Subject: [Wesnoth-cvs-commits] wesnoth/src filesystem.cpp
Date: Tue, 05 Apr 2005 17:47:27 -0400

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     David White <address@hidden>    05/04/05 21:47:27

Modified files:
        src            : filesystem.cpp 

Log message:
        fixed filesystem read functions to load in binary mode on Windows

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/filesystem.cpp.diff?tr1=1.66&tr2=1.67&r1=text&r2=text

Patches:
Index: wesnoth/src/filesystem.cpp
diff -u wesnoth/src/filesystem.cpp:1.66 wesnoth/src/filesystem.cpp:1.67
--- wesnoth/src/filesystem.cpp:1.66     Sun Mar 27 23:06:16 2005
+++ wesnoth/src/filesystem.cpp  Tue Apr  5 21:47:27 2005
@@ -1,4 +1,4 @@
-/* $Id: filesystem.cpp,v 1.66 2005/03/27 23:06:16 gruikya Exp $ */
+/* $Id: filesystem.cpp,v 1.67 2005/04/05 21:47:27 Sirp Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -501,7 +501,7 @@
        }
 #else
        if (!fname.empty() && fname[0] != '/' && !game_config::path.empty()) {
-               std::ifstream *s = new std::ifstream((game_config::path + "/" + 
fname).c_str());
+               std::ifstream *s = new std::ifstream((game_config::path + "/" + 
fname).c_str(),std::ios_base::binary);
                if (s->is_open())
                        return s;
                delete s;
@@ -510,7 +510,7 @@
 
        // 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());
+       return new std::ifstream(fname.c_str(),std::ios_base::binary);
 }
 
 std::ostream *ostream_file(std::string const &fname)
@@ -605,7 +605,7 @@
        if (the_collection->getEntry(name))
                return true;
 #endif
-       std::ifstream file(name.c_str());
+       std::ifstream file(name.c_str(),std::ios_base::binary);
        if (file.rdstate() != 0)
                return false;
        file.close();




reply via email to

[Prev in Thread] Current Thread [Next in Thread]