]> git.lyx.org Git - lyx.git/blobdiff - src/support/copy.C
make "make distcheck" work
[lyx.git] / src / support / copy.C
index 306d788cc7ba3750335ded6e89ecd92b3d2aa1d5..cf51ce37b436c0c947d3cc2b7f51bf2b4a81eba7 100644 (file)
 #include <fstream>
 
 #include "support/lyxlib.h"
-#include "support/std_string.h"
+
 
 using std::ifstream;
 using std::ofstream;
 using std::ios;
+using std::string;
+
 
 bool lyx::support::copy(string const & from, string const & to)
 {
-       ifstream ifs(from.c_str());
+       ifstream ifs(from.c_str(), ios::binary | ios::in);
        if (!ifs)
                return false;
-       ofstream ofs(to.c_str(),
-                    ios::binary | ios::out | ios::trunc);
+
+       ofstream ofs(to.c_str(), ios::binary | ios::out | ios::trunc);
        if (!ofs)
                return false;
+
        ofs << ifs.rdbuf();
-       if (ofs.good())
-               return true;
-       return false;
+       return ofs.good();
 }