|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r62919 - in trunk: boost/filesystem/v2 boost/filesystem/v3 libs/filesystem/v2/test libs/filesystem/v3/test
From: bdawes_at_[hidden]
Date: 2010-06-13 13:33:40
Author: bemandawes
Date: 2010-06-13 13:33:39 EDT (Sun, 13 Jun 2010)
New Revision: 62919
URL: http://svn.boost.org/trac/boost/changeset/62919
Log:
Fix #3863, stream I/O with space in named failed to roundtrip
Text files modified:
trunk/boost/filesystem/v2/path.hpp | 4 ++--
trunk/boost/filesystem/v3/path.hpp | 4 ++--
trunk/libs/filesystem/v2/test/path_test.cpp | 4 ++--
trunk/libs/filesystem/v3/test/path_unit_test.cpp | 2 +-
4 files changed, 7 insertions(+), 7 deletions(-)
Modified: trunk/boost/filesystem/v2/path.hpp
==============================================================================
--- trunk/boost/filesystem/v2/path.hpp (original)
+++ trunk/boost/filesystem/v2/path.hpp 2010-06-13 13:33:39 EDT (Sun, 13 Jun 2010)
@@ -594,7 +594,7 @@
typename Path::string_type::traits_type >& is, Path & ph )
{
typename Path::string_type str;
- is >> str;
+ std::getline(is, str); // See ticket 3863
ph = str;
return is;
}
@@ -620,7 +620,7 @@
basic_path< String, Traits > & ph )
{
String str;
- is >> str;
+ std::getline(is, str); // See ticket 3863
ph = str;
return is;
}
Modified: trunk/boost/filesystem/v3/path.hpp
==============================================================================
--- trunk/boost/filesystem/v3/path.hpp (original)
+++ trunk/boost/filesystem/v3/path.hpp 2010-06-13 13:33:39 EDT (Sun, 13 Jun 2010)
@@ -558,7 +558,7 @@
inline std::istream& operator>>(std::istream & is, path& p)
{
std::string str;
- is >> str;
+ std::getline(is, str); // See ticket #3863
p = str;
return is;
}
@@ -566,7 +566,7 @@
inline std::wistream& operator>>(std::wistream & is, path& p)
{
std::wstring str;
- is >> str;
+ std::getline(is, str); // See ticket #3863
p = str;
return is;
}
Modified: trunk/libs/filesystem/v2/test/path_test.cpp
==============================================================================
--- trunk/libs/filesystem/v2/test/path_test.cpp (original)
+++ trunk/libs/filesystem/v2/test/path_test.cpp 2010-06-13 13:33:39 EDT (Sun, 13 Jun 2010)
@@ -1359,10 +1359,10 @@
# if !defined( BOOST_MSVC ) || BOOST_MSVC > 1300 // bypass VC++ 7.0 and earlier
std::cout << "\nInserter and extractor test...";
std::stringstream ss;
- ss << fs::path( "foo/bar" ) << std::endl;
+ ss << fs::path( "foo bar" ) << std::endl; // ensure space in path roundtrips
fs::path round_trip;
ss >> round_trip;
- BOOST_TEST( round_trip.string() == "foo/bar" );
+ BOOST_TEST( round_trip.string() == "foo bar" );
std::cout << round_trip.string() << "..." << round_trip << " complete\n";
# endif
Modified: trunk/libs/filesystem/v3/test/path_unit_test.cpp
==============================================================================
--- trunk/libs/filesystem/v3/test/path_unit_test.cpp (original)
+++ trunk/libs/filesystem/v3/test/path_unit_test.cpp 2010-06-13 13:33:39 EDT (Sun, 13 Jun 2010)
@@ -389,7 +389,7 @@
{
std::cout << "testing inserter and extractor..." << std::endl;
- path p1("foo");
+ path p1("foo bar"); // verify space in path roundtrips per ticket #3863
path p2;
std::stringstream ss;
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk