]> git.lyx.org Git - features.git/commitdiff
Enable lyx::copy to work when compiled with the gcc 2.95 compiler and stdlib.
authorAngus Leeming <leeming@lyx.org>
Thu, 17 Feb 2005 17:53:33 +0000 (17:53 +0000)
committerAngus Leeming <leeming@lyx.org>
Thu, 17 Feb 2005 17:53:33 +0000 (17:53 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9645 a592a061-630c-0410-9148-cb99ea01b6c8

src/support/ChangeLog
src/support/copy.C

index 83ed159fcbb5261ec4cee7060f06f1627de3612b..a22fbd5991041bcd9ef06858afe11f6d2653e6ca 100644 (file)
@@ -1,3 +1,9 @@
+2005-02-17  Angus Leeming  <leeming@lyx.org>
+
+       * copy.C (copy): Pass the ios::in flag to the ifstream constructor.
+       Enables copying to work when the code is compiled with the gcc 2.95
+       compiler and stdlib.
+
 2005-02-15  Angus Leeming  <leeming@lyx.org>
 
        * environment.C: add missing #include.
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();
 }