Cope with I/O errors or premature eof

[SVN r63099]
This commit is contained in:
Beman Dawes
2010-06-19 13:25:55 +00:00
parent cab10052da
commit a6f0ee9b19
2 changed files with 22 additions and 8 deletions

View File

@ -13,7 +13,9 @@
#define BOOST_IO_QUOTED_MANIP
#include <iosfwd>
#include <ios>
#include <string>
#include <iterator>
#include <boost/io/ios_state.hpp>
namespace boost
@ -130,11 +132,17 @@ namespace boost
{
boost::io::ios_flags_saver ifs(is);
is >> std::noskipws;
for (;;)
for (;;)
{
is >> c;
if (!is.good()) // cope with I/O errors or end-of-file
break;
if (c == proxy.escape)
{
is >> c;
if (!is.good()) // cope with I/O errors or end-of-file
break;
}
else if (c == proxy.delim)
break;
proxy.string += c;