Remove incorrect assertion from filesystem::absolute

The assertion is wrong, it should be *s.end() == 0, but that's not
allowed. Just remove it, but keep the comment.

	* src/c++17/fs_ops.cc (absolute(const path&, error_code&))
	[_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Remove bogus assertion.

From-SVN: r271300
This commit is contained in:
Jonathan Wakely 2019-05-16 23:52:10 +01:00 committed by Jonathan Wakely
parent afc819e866
commit 7110128236
2 changed files with 4 additions and 3 deletions

View File

@ -1,5 +1,8 @@
2019-05-16 Jonathan Wakely <jwakely@redhat.com>
* src/c++17/fs_ops.cc (absolute(const path&, error_code&))
[_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Remove bogus assertion.
* include/std/variant (__overload_set): Remove.
(_Arr): New helper.
(_Build_FUN): New class template to define a single FUN overload,

View File

@ -96,6 +96,7 @@ fs::absolute(const path& p, error_code& ec)
}
#ifdef _GLIBCXX_FILESYSTEM_IS_WINDOWS
// s must remain null-terminated
wstring_view s = p.native();
if (p.has_root_directory()) // implies !p.has_root_name()
@ -108,9 +109,6 @@ fs::absolute(const path& p, error_code& ec)
s.remove_prefix(std::min(s.length(), pos) - 1);
}
// s must be null-terminated
__glibcxx_assert(!s.empty() && s.back() == 0);
uint32_t len = 1024;
wstring buf;
do