+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.
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();
}