Ticket #5989 (closed Bugs: fixed)

Opened 6 years ago

Last modified 5 years ago

path iterator appends / instead of \ on windows

Reported by: Sachin Garg <schngrg@…> Owned by: bemandawes
Milestone: To Be Determined Component: filesystem
Version: Boost 1.47.0 Severity: Problem
Keywords: Cc: schngrg@…


In boost v1.47, filesystem\v\src\path.cpp, inside function m_path_iterator_increment, on line line 654,

It should be:

it.m_element.m_pathname = preferred_separator;

Instead of

it.m_element.m_pathname = separator;

Reason: In below sample code

boost::filesystem::path new_path; for (fs::path::iterator i=path.begin();i!=path.end();i++) {


On windows when iterating a path using above code, line 654 incorrectly appends / instead of \ after drive letter.

For example,





Change History

comment:1 Changed 6 years ago by Sachin Garg <schngrg@…>

  • Cc schngrg@… added

comment:2 Changed 6 years ago by Sachin Garg <schngrg@…>

File path is for v3: filesystem\v3\src\path.cpp

comment:3 Changed 5 years ago by bemandawes

  • Status changed from new to closed
  • Resolution set to fixed

The code is correct as written. Iteration returns the generic format, as this is required for comparison to work correctly.

The reference documentation will been corrected to reflect this, and the source code has been annotated.

The path_test code has also been updated and annotated.




Add a comment

Modify Ticket

Change Properties
<Author field>
as closed
The resolution will be deleted. Next status will be 'reopened'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.