mirror of
https://github.com/boostorg/filesystem.git
synced 2026-02-27 17:02:19 +00:00
Fix #7239, Stack overflow when calling create_directories(":D"). The reported problem was a symptom of an internal bug that caused path::filename() and path::parent_path() to fail on Windows for path(":"), and that in turn caused other functions that depend on filename() or parent_path() to fail, such as create_directories().
[SVN r80279]
This commit is contained in:
@@ -927,6 +927,7 @@ namespace detail
|
||||
}
|
||||
|
||||
path parent = p.parent_path();
|
||||
BOOST_ASSERT_MSG(parent != p, "internal error: p == p.parent_path()");
|
||||
if (!parent.empty())
|
||||
{
|
||||
// determine if the parent exists
|
||||
|
||||
@@ -510,7 +510,7 @@ namespace
|
||||
size_type pos(str.find_last_of(separators, end_pos-1));
|
||||
|
||||
# ifdef BOOST_WINDOWS_API
|
||||
if (pos == string_type::npos)
|
||||
if (pos == string_type::npos && end_pos > 1)
|
||||
pos = str.find_last_of(colon, end_pos-2);
|
||||
# endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user