diff --git a/src/BufferView.C b/src/BufferView.C index 439fba5d4a..949ed8bb23 100644 --- a/src/BufferView.C +++ b/src/BufferView.C @@ -46,7 +46,6 @@ #include "BoostFormat.h" #include -#include extern BufferList bufferlist; @@ -321,16 +320,14 @@ bool BufferView::insertLyXFile(string const & filen) ifstream ifs(fname.c_str()); if (!ifs) { - string const error = strerror(errno); string const file = MakeDisplayPath(fname, 50); #if USE_BOOST_FORMAT - boost::format fmt(_("Could not open the specified document\n%1$s\ndue to the error: %2$s")); + boost::format fmt(_("Could not open the specified document\n%1$s.")); fmt % file; - fmt % error; string text = fmt.str(); #else string text = _("Could not open the specified document\n"); - text += file + _(" due to the error: "); + text += file + "."; text += error; #endif Alert::error(_("Could not open file"), text); diff --git a/src/ChangeLog b/src/ChangeLog index 183b664e12..735265bd5d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2003-03-29 John Levon + + * BufferView.C: + * buffer.C: fix broken strerrors according to Lars + 2003-03-29 John Levon * converters.C: more Alert cleanups diff --git a/src/buffer.C b/src/buffer.C index 2fad83c2f3..4f603d9b21 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -954,17 +954,14 @@ void Buffer::writeFileAscii(string const & fname, int linelen) { ofstream ofs(fname.c_str()); if (!ofs) { - string const error = strerror(errno); string const file = MakeDisplayPath(fname, 50); #if USE_BOOST_FORMAT - boost::format fmt(_("Could not save the document\n%1$s\ndue to the error: %2$s")); + boost::format fmt(_("Could not save the document\n%1$s.")); fmt % file; - fmt % error; string text = fmt.str(); #else string text = _("Could not save the document\n"); - text += file + _(" due to the error: "); - text += error; + text += file + "."; #endif Alert::error(_("Could not save document"), text); return; @@ -994,17 +991,14 @@ void Buffer::makeLaTeXFile(string const & fname, ofstream ofs(fname.c_str()); if (!ofs) { - string const error = strerror(errno); string const file = MakeDisplayPath(fname, 50); #if USE_BOOST_FORMAT - boost::format fmt(_("Could not open the specified document\n%1$s\ndue to the error: %2$s")); + boost::format fmt(_("Could not open the specified document\n%1$s.")); fmt % file; - fmt % error; string text = fmt.str(); #else string text = _("Could not open the specified document\n"); - text += file + _(" due to the error: "); - text += error; + text += file + "."; #endif Alert::error(_("Could not open file"), text); return; diff --git a/src/lyx_cb.C b/src/lyx_cb.C index 6493b5002d..233395c432 100644 --- a/src/lyx_cb.C +++ b/src/lyx_cb.C @@ -41,6 +41,7 @@ #include #include #include +#include using std::vector; using std::ifstream;