fix_long_path (boost::filesystem::path long_path)
{
using namespace boost::filesystem;
+
path fixed = "\\\\?\\";
+ if (boost::algorithm::starts_with(long_path.string(), fixed.string())) {
+ return long_path;
+ }
+
/* We have to make the path canonical but we can't call canonical() on the long path
* as it will fail. So we'll sort of do it ourselves (possibly badly).
*/
fixed_bar += boost::filesystem::current_path();
fixed_bar /= "bar";
BOOST_CHECK_EQUAL (fix_long_path("bar"), fixed_bar);
+
+ BOOST_CHECK_EQUAL (fix_long_path("\\\\?\\c:\\foo"), "\\\\?\\c:\\foo");
#else
BOOST_CHECK_EQUAL (fix_long_path("foo/bar/baz"), "foo/bar/baz");
#endif