]> git.lyx.org Git - lyx.git/blobdiff - src/support/copy.C
make "make distcheck" work
[lyx.git] / src / support / copy.C
index b39c771b63003e0b6d834a5083b5d851ac9a02b9..cf51ce37b436c0c947d3cc2b7f51bf2b4a81eba7 100644 (file)
@@ -23,15 +23,14 @@ using std::string;
 
 bool lyx::support::copy(string const & from, string const & to)
 {
-       ifstream ifs(from.c_str(), ios::binary);
+       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();
 }