Boost C++ Libraries: Ticket #5989: path iterator appends / instead of \ on windows https://svn.boost.org/trac10/ticket/5989 <p> In boost v1.47, filesystem\v\src\path.cpp, inside function m_path_iterator_increment, on line line 654, </p> <p> It should be: </p> <blockquote> <p> it.m_element.m_pathname = preferred_separator; </p> </blockquote> <p> Instead of </p> <blockquote> <p> it.m_element.m_pathname = separator; </p> </blockquote> <p> Reason: In below sample code </p> <blockquote> <p> boost::filesystem::path new_path; for (fs::path::iterator i=path.begin();i!=path.end();i++) { </p> <blockquote> <p> new_path/=(*i); </p> </blockquote> </blockquote> <p> On windows when iterating a path using above code, line 654 incorrectly appends / instead of \ after drive letter. </p> <p> For example, </p> <blockquote> <p> D:\path\file </p> </blockquote> <p> Becomes, </p> <blockquote> <p> D:/path\file </p> </blockquote> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5989 Trac 1.4.3 Sachin Garg <schngrg@…> Fri, 07 Oct 2011 06:42:19 GMT cc set https://svn.boost.org/trac10/ticket/5989#comment:1 https://svn.boost.org/trac10/ticket/5989#comment:1 <ul> <li><strong>cc</strong> <span class="trac-author">schngrg@…</span> added </li> </ul> Ticket Sachin Garg <schngrg@…> Fri, 07 Oct 2011 06:44:31 GMT <link>https://svn.boost.org/trac10/ticket/5989#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5989#comment:2</guid> <description> <p> File path is for v3: filesystem\v3\src\path.cpp </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Beman Dawes</dc:creator> <pubDate>Fri, 20 Jan 2012 12:48:37 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/5989#comment:3 https://svn.boost.org/trac10/ticket/5989#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> The code is correct as written. Iteration returns the generic format, as this is required for comparison to work correctly. </p> <p> The reference documentation will been corrected to reflect this, and the source code has been annotated. </p> <p> The path_test code has also been updated and annotated. </p> <p> Thanks, </p> <p> --Beman </p> Ticket