diff --git a/boost/io/detail/quoted_manip.hpp b/boost/io/detail/quoted_manip.hpp index 13cfc35..35b82d5 100644 --- a/boost/io/detail/quoted_manip.hpp +++ b/boost/io/detail/quoted_manip.hpp @@ -129,7 +129,7 @@ namespace boost is >> c; if (c != proxy.delim) { - proxy.string = c; + is.unget(); is >> proxy.string; return is; } diff --git a/libs/io/test/quoted_manip_test.cpp b/libs/io/test/quoted_manip_test.cpp index eb481b7..27e9502 100644 --- a/libs/io/test/quoted_manip_test.cpp +++ b/libs/io/test/quoted_manip_test.cpp @@ -27,12 +27,12 @@ int main() const string s1("foo\\bar, \" *"); string r; // test results - ss << quoted(s1); - ss >> r; + ss << quoted(s1) << std::endl; + std::getline(ss, r); BOOST_TEST_EQ(r, "\"foo\\\\bar, \\\" *\""); - ss << quoted(s1.c_str()); - ss >> r; + ss << quoted(s1.c_str()) << std::endl; + std::getline(ss, r); BOOST_TEST_EQ(r, "\"foo\\\\bar, \\\" *\""); ss << quoted(s1); @@ -45,8 +45,8 @@ int main() string s2("'Jack & Jill'"); - ss << quoted(s2, '&', '\''); - ss >> r; + ss << quoted(s2, '&', '\'') << std::endl; + std::getline(ss, r); BOOST_TEST_EQ(r, "'&'Jack && Jill&''"); ss << quoted(s2, '&', '\''); @@ -56,8 +56,8 @@ int main() wstring ws1(L"foo$bar, \" *"); wstring wr; // test results - wss << quoted(ws1, L'$'); - wss >> wr; + wss << quoted(ws1, L'$') << std::endl; + std::getline(wss, wr); BOOST_TEST(wr == wstring(L"\"foo$$bar, $\" *\"")); wss << quoted(ws1, L'$'); @@ -88,5 +88,5 @@ int main() // ss >> quoted(s1); // ss >> quoted("foo"); - return 0; + return boost::report_errors(); }