[Boost-bugs] [Boost C++ Libraries] #10380: filesystem directory iterator throws on increment

Subject: [Boost-bugs] [Boost C++ Libraries] #10380: filesystem directory iterator throws on increment
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-08-19 14:41:56


#10380: filesystem directory iterator throws on increment
-----------------------------------+------------------------
 Reporter: Richard <richard.j@…> | Owner: bemandawes
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: filesystem
  Version: Boost 1.55.0 | Severity: Problem
 Keywords: |
-----------------------------------+------------------------
 The following code throws an exception:

 std::for_each( recursive_directory_iterator(path_to_root_dir),
 recursive_directory_iterator(),
                        []( const directory_entry& de )
                        {
                            remove_all( de.path() );
                        }
                      );

 if path_to_root_dir contains only a single sub-directory.
 This happens in the increment operator of the iterator at line 791
 (boost/filesystem/operations.hpp:
 m_stack.push(directory_iterator(m_stack.top()->path()));

 The sub-directory is successfully deleted. The exception is thrown after
 the deletion when the iterator is incremented

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/10380>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:16 UTC