]> git.lyx.org Git - lyx.git/blobdiff - src/support/copy.C
Make it possible to uses non-ascii labelstring, endlabelstring and
[lyx.git] / src / support / copy.C
index 6ad896f1566d8e53a978155d6ba3124ad91091f8..2d994b8450e91549589467c5c5b5c30b40fd3e39 100644 (file)
@@ -15,6 +15,9 @@
 #include "support/lyxlib.h"
 
 
+namespace lyx {
+
+
 using std::ifstream;
 using std::ofstream;
 using std::ios;
@@ -23,15 +26,17 @@ 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();
 }
+
+
+} // namespace lyx