mirror of
https://github.com/boostorg/filesystem.git
synced 2026-02-01 20:42:08 +00:00
Fix ticket #10388, an occasional failure of temp_directory_path to deal correctly with the trailing separator. A path member function remove_trailing_separator() was added publicly since this may be useful to users.
This commit is contained in:
@@ -254,6 +254,13 @@ namespace filesystem
|
||||
return *this;
|
||||
}
|
||||
|
||||
path& path::remove_trailing_separator()
|
||||
{
|
||||
if (!m_pathname.empty() && is_separator(m_pathname[m_pathname.size() - 1]))
|
||||
m_pathname.erase(m_pathname.size() - 1);
|
||||
return *this;
|
||||
}
|
||||
|
||||
path& path::replace_extension(const path& new_extension)
|
||||
{
|
||||
// erase existing extension, including the dot, if any
|
||||
|
||||
Reference in New Issue
Block a user