mirror of
https://github.com/boostorg/filesystem.git
synced 2026-01-19 04:12:09 +00:00
When weakly_canonical was called with a relative input path, the operation would test path elements for existence, which meant resolving them relative to the current path instead of the base path specified in the call. To mitigate this, make the source path absolute using the specified base path. As a side effect, this fixes incorrect path produced on Windows if the input path started with "..". The algorithm was unable to remove the last element of the head path because there was none. As a result, the remaining elements of the input path were appended to the full base path by canonical. Fixes to https://github.com/boostorg/filesystem/issues/311.